ashly123 Posted June 9, 2010 Share Posted June 9, 2010 Hi, I am a newbie in string functions in php. I have a text file which contains some lines of text in a particular format. I am using php to maniputlate this text file. Text1 = This is my first line of text Text2 = This is my second text Text3 = This is my third text Text5 = This is fifth line of text Text10 = This is tenth line in the file .... .... I would like to insert some missing text at the end or in between the existing lines. For example, I would like to write Text7 in the file in the exact place now. Can anyone please give me a solution for this? After the insertion, the file should look like this: Text1 = This is my first line of text Text2 = This is my second text Text3 = This is my third text Text5 = This is fifth line of text Text7 = This is seventh line in the file Text10 = This is tenth line in the file .... .... Link to comment https://forums.phpfreaks.com/topic/204258-insert-text-to-particular-position-in-a-file/ Share on other sites More sharing options...
kenrbnsn Posted June 9, 2010 Share Posted June 9, 2010 Please do not double post. You already have a thread on this question at http://www.phpfreaks.com/forums/index.php/topic,300484.0.html Ken Link to comment https://forums.phpfreaks.com/topic/204258-insert-text-to-particular-position-in-a-file/#findComment-1069803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.