Re: file function

From: Date: Sat, 09 Jul 2005 13:07:06 +0000
Subject: Re: file function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218382@lists.php.net to get a copy of this message
On 7/9/05, Joseph Lee <joe_sun_lee@yahoo.com> wrote: > Hi, > > I tried file() in the following lines: > > <?php > $authFile = file("/tmp/authenticate.txt"); > print "authFile = $authFile"; > ?> > > However, it only gave me > authFile = Array > > What's wrong with this file function? I tried single > quotes, but got the same answer, too. Trying single quotes should have gotten you >authFile = $authFile< (without the arrows). There is nothing wrong with the file function. It´s supposed to return an array. If you want it to spit out every element in the array, then perhaps you could use the print_r, var_dump or var_export functions. If you simply want to get the contents of the file into a string, then use file_get_contents(). > > Thanks, > Joe > > > > ____________________________________________________ > Sell on Yahoo! Auctions – no fees. Bid on great items. > http://auctions.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#218382) next »