There are a couple of ways:
- If the file is small enough, I suppose you could use the
http://ca.php.net/manual/en/function.file.php file function, which loads
the file in array (one element per line).
- If the file is bigger, you can use the normal fopen() functionality
and then use http://ca.php.net/manual/en/function.fgets.php fgets().
Hope this helps!
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Come visit us at http://www.phparch.com!
--- Begin Message ---
here's an example of a text file I need to read...
I believe each line is seperated by a carriage return.
How can I read this in one line at a time in to a variable?
I'm assuming that I could then explode that variable using the pipe as the seperator
--- End Message ---
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php