Voting

: min(five, three)?
(Example: nine)

The Note You're Voting On

Smokey
15 years ago
for nested and same name values i'v made up this little bit for getting and displaying multiable values from google's geocode when a exact match is not found it returns all close matches in the following format(this is an abriged version of there output)

<Response>
<Placemark id="1">
<address> New York 24, NY, USA</address>
<AddressDetails>
..................
</AddressDetails>
<Point>
<coordinates>-73.5850086,40.7207442,0</coordinates>
</Point>
</Placemark>
<Placemark id="2">
<address>New York 27, NY, USA</address>
<AddressDetails>
...................
</AddressDetails>
<Point>
<coordinates>-72.8987835,40.8003588,0</coordinates>
</Point>
</Placemark>
<Placemark id="3">
<address>Cedar Place School, 20 Cedar Pl, Yonkers, NY 10705, USA</address>
<AddressDetails>
..................
</AddressDetails>
<Point>
<coordinates>-73.8966320,40.9256520,0</coordinates>
</Point>
</Placemark>
</Response>

<?php
// get and breakdown the results then store them in $var's
$Address = "99999 parkplace, new york, NY";
$urladdress = urlencode($Address);
$Base_url = "http://maps.google.com/maps/geo?q=";
$urlParts = "&output=xml";
$urlrequest = $Base_url . $urladdress . $urlParts;
$xml = simplexml_load_file($urlrequest);
$num = "0";
foreach (
$xml->Response->Placemark as $value){
$num++;
$GeoFindAdd{$num} = $value->address;
$GeoFindCords{$num} = $value->Point->coordinates;
}

// a simple display for the results
echo "Found ",$num," Possable Geo Data Sets <br>";
$CountNumResults = "0";
for ( ;
$num > 0; $num--){
$CountNumResults++;
echo
$countnum,"<br> Address = ",$GeoFindAdd{$num},"<br> Coordinates = ",$GeoFindCords{$num},"<br>";
}
echo
"END";
?>

<< Back to user notes page

To Top