Re: returning an array from a function?

From: Date: Fri, 26 Oct 2007 07:18:51 +0000
Subject: Re: returning an array from a function?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-263688@lists.php.net to get a copy of this message
$mve_array = convert( $latitude, $longitude ); or, in convert(), before the first call to $mve_array: global $mve_array; On 26/10/2007, at 8:09, info@phpyellow.com wrote:
Hello all, function convert( $latitude, $longitude ) { $mve_latitude = $latitude; // actually other processing within this function determines this $mve_longitude = $longitude // actually other processing within this function determines this $mve_both = $mve_latitude . ", " . $mve_longitude; // prepare return values $mve_array[0] = $mve_latitude; $mve_array[1] = $mve_longitude; $mve_array[2] = $mve_both; return $mve_array; } // function $latitude = 23.263400; $longitude = 80.110030 convert( $latitude, $longitude ); print_r( $mve_array ); .. the above does not return a value in the array. What do I have to change to receive an array with global scope from this function? I read several pages of docs on php.net but the light didn't go on... Sincerely, Rob. --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- Simon Welsh Admin of http://simon.geek.nz/ Windows is a joke operating system. Hell, it's not even an operating system. NT is Not Tough enough for me either. 95 is how may times it will crash an hour. http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

« previous php.general (#263688) next »