Re: .DAT file with PHP

From: Date: Wed, 08 Mar 2006 15:46:52 +0000
Subject: Re: .DAT file with PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-231666@lists.php.net to get a copy of this message
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@pocket.com [mailto:jblanchard@pocket.com] Sent: Wednesday, March 08, 2006 9:58 PM To: phpnet@blizhosting.com; 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

« previous php.general (#231666) next »