|
Subject:
|
How to return array value from a function
|
|
Posted By:
|
nebpro
|
Post Date:
|
9/28/2004 6:53:42 PM
|
I am totally lost here. I am writing a function that will read the data from text file and then return the array. Below is the function that I write. Can anybody help me out with the code? Thanks.
$fileName = "addresses.txt"; function MyReadFile($fileName){ $address = fopen($fileName, "r"); flock($address, LOCK_SH); while(!feof($address)){ global $addAscv[]=fgets($address, 5096); } flock($address, LOCK_UN); fclose($address); return $addAscv[]; }
|
|
Reply By:
|
Snib
|
Reply Date:
|
9/29/2004 12:14:23 PM
|
Change return $addAscv[]; to return $addAscv;
-Snib <>< http://www.snibworks.com There are only two stupid questions: the one you don't ask, and the one you ask more than once ;-)
|