C.F. Scheidecker Antunes wrote:
Hello all,

I need to read lines within a text file that might have a " value='somevalue' " string the position of "value=" varies from line to line but there's only one "value=" in each line.

So what I need to do is to parse the file and find the "value=" and put their values in an array.

http://www.php.net/parse_ini_file

Not sure if this is what you're doing exactly, but if this is a settings / ini file you're creating then you can also use parse_ini_file. It'll allow you to create files like the php.ini and parse the values, in your case:

-----------test.ini----------

; I am a comment to tell you what snLADEFEFfdgvalue means
snLADEFEFfdgvalue="1234"rwgjngrgj
value="23456"gkerlgwg
132fngdhbvalue="5678"bfl928


-----------test.php---------- <?php

$settings = parse_ini_file('test.ini');

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to