Re: returning an array from a function?
| From: | info at phpyellow dot com | Date: | Sat, 27 Oct 2007 12:38:17 +0000 |
| Subject: | Re: returning an array from a function? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263744@lists.php.net to get a copy of this message | ||
Hello List,
Your help produced a refined function. The function converts a Google Map latitude and longitude
into an equivalent Microsoft Virtual Earth latitude and longitude.
Here is an example of how the function works, along with source code:
http://www.globalissa.com/articles/convert_google_to_mve_array_doc.php
Thank you to Ted and others who helped.
sincerely,
Rob
> At 12:09 AM -0700 10/26/07, 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.
>
> Rob:
>
> Why use a global?
>
> Plus, your function is returning an array, but you're not catching it.
>
> $mve_array = convert( $latitude, $longitude );
>
> Example:
>
> http://www.webbytedd.com/bbb/array-function/
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com
> http://ancientstones.com
> http://earthstones.com
>
>