Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Reading a file into an array
February 6, 2008, 12:29 pm
rate this thread
I just cannot find it now.
Basically I want to read in a file, a number of lines into an array.
Next I have "old" and "new" values, I want to find and replace these
(order is not important)
Finally write file back to disk.
Is there such a function as the first one, I recall finding it once,
but looking at php.net now did not succeed...
February 6, 2008, 12:31 pm
February 6, 2008, 1:10 pm
Re: Reading a file into an array
No. But you can hack something quick&dirty like this:
file_put_contents($filename, implode("\n", $lines) );
Yeah. RTFM on the str_replace() function.
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
Your sister swims out to meet troop ships.