fwrite pointer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webmobster
Forum Newbie
Posts: 1
Joined: Thu May 18, 2006 1:05 pm

fwrite pointer

Post 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
:)
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

fseek()
Post Reply