Re: Help seeking in a file a specific string
- From: "Steve" <googlespam@xxxxxxxxxxxxx>
- Date: 28 Oct 2005 05:44:39 -0700
> 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
.
- References:
- Help seeking in a file a specific string
- From: Jorge A
- Help seeking in a file a specific string
- Prev by Date: Question on PhP, MySQL
- Next by Date: Re: Help seeking in a file a specific string
- Previous by thread: Help seeking in a file a specific string
- Next by thread: Re: Help seeking in a file a specific string
- Index(es):
Relevant Pages
|