How to return array value from a function
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[];
}
|