George - didn't you come to us with this exact problem a month or so ago ?

I think chris probably meant not readline but fgets() and / or file()

fgets() reads a specified chunk size into a string or other variable.
file() reads a file line by line (separator is the newline character: :

array file (string filename [, int use_include_path])

To be honest, if you will receive an unknown number of fields, you might be better transforming the whole lot to XML and storing the XML en-bloc in the database - unless you require to search on each field from the off.

You can parse the XML to fieldsets at a later date when you've established just *what* fields are going to be sent. At least this way you can fool around with XSL to display at least the common information in each file, but still retain the oddities for later analysis, without having to set up a DB with dozens of possibly redundant fields.

HTH - my 2cv err - 2c lol

Neil Smith.

At 23:59 11/02/2003 +0000, you wrote:
From: "George Pitcher" <[EMAIL PROTECTED]>
To: "Chris Kranz" <[EMAIL PROTECTED]>,
        <[EMAIL PROTECTED]>
Date: Tue, 11 Feb 2003 12:25:14 -0000
Subject: RE: [PHP-WIN] reading lines from a file

Chris,

I couldn't find any readline function in the manual - did I miss it?

It isn't as simple as you say, because, to start with, I don't know how many
fields there are going to be, I don't know how I'm going to build my array
to record-level sets.

I'm not really looking for someone to provide the code (snippets accepted
though) but I would appreciate being pointed in the right direction.

Cheers

George

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

Reply via email to