NYCPHP Meetup

NYPHP.org

[nycphp-talk] fgetcsv alternatives?

Allen Shaw ashaw at iifwp.org
Tue Aug 23 14:12:08 EDT 2005


Fan, Wellington wrote:

>I have a large buffer that I'd like to parse as CSV -- so is there a
>function similar to fgetcsv() that could operate on a string buffer rather
>than a filehandle?
>
Why not explode()?

<?
$lines = explode("\n", $buffer);
foreach ($lines as $line) {
    $fields = explode("\t", $line);
}
?>

-- 
Allen Shaw
Polymer (http://polymerdb.org)

Fine-grained control over how your users access your data: 
user permissions, reports, forms, ad-hoc queries -- all 
centrally managed.








More information about the talk mailing list