# Php and txt

**URL:** <https://forum.kirupa.com/t/php-and-txt/172230>\
**Category:** Uncategorized\
**Created:** [December 12, 2005, 5:50pm UTC](https://forum.kirupa.com/t/php-and-txt/172230 "2005-12-12T17:50:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrollwitme](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@pbrollwitme](https://forum.kirupa.com/u/pbrollwitme)\
**Post date:** [December 12, 2005, 5:50pm UTC](https://forum.kirupa.com/t/php-and-txt/172230/1 "2005-12-12T17:50:33Z")

</div>

hey everyone…i’m tryin to use php to insert text into a .txt file, but i don’t want it to append to the end of the file, and i don’t want it to append to the top of the file. basically, my text file looks like this:

notmessage=  
&message=Line1  
line2  
line3  
line4  
etc.

I want the php to insert the file at line1, and to move line1 and each subsiquent line down so that line1 becomes line2, line2 becomes line3, etc

any ideas??  
thanks
