extracting multiple fields from a text file using php

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-05-16T12:40:12Z Indexed on 2010/05/16 12:50 UTC
Read the original article Hit count: 142

Filed under:
|

Hi,

what is the best way of extracting multiple (~40 values) from a text file using php?

the data is more or less like:

NAMEA                   valuea
NAMEB                   valueb

I'm looking for a proper* approach to extracting this data into a data-structure, because i will need to specify regexs for all of them (all 40).

did i make myself clear?

*meaning, the default/painful method would be for me to do:

$namea = extractfunction("regexa", $textfilevalue);
$nameb = extractfunction("regeb", $textfilevalue);

... 40 times!

© Stack Overflow or respective owner

Related posts about php

Related posts about regex