Jabez Gan wrote:

Sorry im new but, how do we read from a file to an array? I've studied C but
not with PHP and it's not working for me... Suggestions?



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 9:58 PM
To: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: RE: [PHP] .DAT file with PHP

[snip]
I want to use PHP to show the contents of the DAT from back to front.
HOw do

I do that?

[/snip]

Open the file, read it into an array, read the array backwards and close the
file. Start with http://www.php.net/fopen and http://www.php.net/array ....
they are both in the manual.

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




use the file() function (http://www.php.net/file), or, use fopen/fread to get the file into a string, then explode on \n or \r (depending on your fileformat/OS). Once done, you'll have a file in an array (line by line)

-t ul

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

Reply via email to