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 ;-)

Go to topic 19920

Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754
Return to index page 753
Return to index page 752
Return to index page 751
Return to index page 750