env3rt Posted October 1, 2007 Share Posted October 1, 2007 $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"; Quote Link to comment https://forums.phpfreaks.com/topic/71451-appending-to-a-certain-part-in-the-file-help/ Share on other sites More sharing options...
BlueSkyIS Posted October 1, 2007 Share Posted October 1, 2007 within the target file, is there any regular delimiter marking where you want to insert text? can you reliably determine where the new content be inserted inside the file? Quote Link to comment https://forums.phpfreaks.com/topic/71451-appending-to-a-certain-part-in-the-file-help/#findComment-359690 Share on other sites More sharing options...
env3rt Posted October 1, 2007 Author Share Posted October 1, 2007 Umm I'm not sure I'd probably just put a whole bunch of enters so when it is appended there and that line is full it will go to the next empty line Quote Link to comment https://forums.phpfreaks.com/topic/71451-appending-to-a-certain-part-in-the-file-help/#findComment-359698 Share on other sites More sharing options...
BlueSkyIS Posted October 2, 2007 Share Posted October 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/71451-appending-to-a-certain-part-in-the-file-help/#findComment-359701 Share on other sites More sharing options...
env3rt Posted October 2, 2007 Author Share Posted October 2, 2007 umm I was hoping someone could provide ways how Quote Link to comment https://forums.phpfreaks.com/topic/71451-appending-to-a-certain-part-in-the-file-help/#findComment-359707 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.