if i have a txt file that looks like...

$news=this is the news bla bla&
$bio=bla bla bla bla&

$contact=bla bla bla bla&

how can i just replace the text of one of these lines without touching the other lines?

i will be using a form to submit the new data, and the lines in the text file must start with &varname= and end with a &

also, i want to convert any & symbol within the text that is submitted from the form to %26

help is much appreciatied!!!

    oh yeah this txt file is going to be read into flash

      get the file contents [get_file_contents()], split the string up per each new line [explode()], do a loop writing each line onto a string until it reaches the line you want to edit. When it reaches the line you want to edit, write the new line to the string, and carry on writing till all the lines are gone. Then write this new string into the file [fwrite()]

      EDIT: use eregi_replace() to change & to what you want

        Write a Reply...