You are here: Re: Help seeking in a file a specific string « All PHP « IT news, forums, messages
Re: Help seeking in a file a specific string

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация