Re: .DAT file with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: jblanchard@xxxxxxxxxx [mailto:jblanchard@xxxxxxxxxx] Sent: Wednesday, March 08, 2006 9:58 PM
To: phpnet@xxxxxxxxxxxxxxx; php-general@xxxxxxxxxxxxx
Subject: RE:  .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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux