mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
26 lines
424 B
PHP
26 lines
424 B
PHP
<?php
|
|
class geonames
|
|
{
|
|
|
|
public static function name_from_id($geonameid)
|
|
{
|
|
|
|
$url = 'http://localization.webservice.alchemyasp.com/get_name.php?geonameid='.$geonameid;
|
|
|
|
$ret = '';
|
|
|
|
$xml = p4::getUrl($url);
|
|
if($xml)
|
|
{
|
|
|
|
$sxe = simplexml_load_string($xml);
|
|
|
|
if($sxe && ($geoname = $sxe->geoname))
|
|
{
|
|
$ret = (string)$geoname->city.', '.(string)$geoname->country;
|
|
}
|
|
}
|
|
return $ret;
|
|
}
|
|
|
|
} |