The easiest way would be to read the date into an array using the file() function. Then find the row containing 'john' and change it 'joe. Finally write the array back. Only drawback would be that for extremely large files you might run into memory problems when trying to read all the entries to memory. But then again, if you're files really are growing out of proportions I would strongly recommend the use of a database system like MySQL. It's not a lie if YOU believe it ;-)
basically, you've pulled the info out of the file, searched throughthe array element by element and found the one u want, replaced it with the string u wanted, and then over-writtern the original file with the old elements, and the new one, in order.
cheers
Siberd
mail: siberdude@ntlworld.com
ICQ: 44167565
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.