|
Posted by Steve on 10/13/79 11:30
> I want to read a file, and write something when a specific string is found.
> param1=32
> param2=2342
> param3=
> param4=23423
> param5=dfad
>
> I want to write after 'param3'. I tried with this but it doesn't work.
Too much hard work with fgets(). Use <http://www.php.net/file> to get
all the lines into an array in one go; step through the array one
element at a time using
<http://www.php.net/manual/en/control-structures.foreach.php>; write
out whatever you want to a new file. When finished successfully, delete
the old file and rename the new one.
---
Steve
Navigation:
[Reply to this message]
|