Enjoy.
Update: sorry, "<" was not replaced by "& lt;" and neither did ">" by "& gt;"
$latitude = .....
$longitude = .....
$geonames_call ="http://ws.geonames.org/timezone?lat=" . $latitude . "&lng=" . $longitude;
$output = file_get_contents( $geonames_call );
preg_match("/<timezoneId>(.*?)<\/timezoneId>/ims", $output, $matches);
$timezone = $matches[1];
echo "Timezone = ", $timezone, "<br/>
";
No hay comentarios:
Publicar un comentario