Page 1 of 1

fwrite pointer

Posted: Thu May 18, 2006 1:31 pm
by webmobster
$myFile = "testFile.txt";
$fh = fopen($myFile, 'a')
$stringData = "anything";
fwrite($fh, $stringData);
Does anyone no a piece of code or a function that will not make the file just add the code on the end but at a cetain area/line or after a certain word because I am trying to make a php file that can write to a php file at a certain place
:)

Posted: Thu May 18, 2006 2:18 pm
by timvw
You will need to rewrite everything after the first modification you've made if you want to insert... (have a look at fseek)

Posted: Thu May 18, 2006 2:18 pm
by alex.barylski
fseek()