Jump to content

Appending to a certain part in the file help.


env3rt

Recommended Posts

$myFile = "testFile.html";
$fh = fopen($myFile, 'a');
$stringData = "$whatuwrote";
fwrite($fh, $stringData);
fclose($fh);

 

Something like that, Do you know how to put that into the middle of a file instead of writing it at the bottom of the page?

 

Example:

echo "hey";

echo "APPEND HERE";

echo "hey";

i mean, how do you know where in the middle to put the new content? if the content is this and you want to put something "in the middle", how do we know where to start?:

 

Ut autem crisare et dolore vel at duis

luptatum nibh nonummy augue feugait

ullamcorper quis ullamcorper praesent

dolore tation. Vel nulla blandit eros vel

delenit et ea eros nibh blandit quis

consectetuer commodo exerci eum.

Erat enim et commodo, ad augue ea

augue praesent feugait dignissim et velit.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.