Php Writing And Reading Files

liunx

Guest
<!--sizeo:14--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->NM, I got it. <!--sizec--></span><!--/sizec--><br />Hi, does anyone know off the top of their head how to append something to a certain part of the file. Not just the beginning or end. <br /><br />Lets say something like this<br /><br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$lines = file("somefile.txt");<br /><br /> foreach ($lines as $line) <br />     if ($line == "line blah")<br />          {  replace this line with "blah" by using an fwrite or something  }<!--c2--></div><!--ec2--><br />Is this even possible? <br /><br /><br />Thanks,<br />Dave<!--content-->
Well congrats,<br />so share already Naughty<!--content-->
 
Back
Top