как загрузить xml из этого кода, пожалуйста

Я хочу загрузить внутренние значения из этого XML-кода:

    <?xml version="1.0" encoding="UTF-8"?>
<geoPlugin>
    <geoplugin_city>Salt Lake City</geoplugin_city>
    <geoplugin_region>UT</geoplugin_region>
    <geoplugin_areaCode>801</geoplugin_areaCode>
    <geoplugin_dmaCode>770</geoplugin_dmaCode>
    <geoplugin_countryCode>US</geoplugin_countryCode>
    <geoplugin_countryName>United States</geoplugin_countryName>
    <geoplugin_continentCode>NA</geoplugin_continentCode>
    <geoplugin_latitude>40.700199127197</geoplugin_latitude>
    <geoplugin_longitude>-111.94339752197</geoplugin_longitude>
    <geoplugin_regionCode>UT</geoplugin_regionCode>
    <geoplugin_regionName>Utah</geoplugin_regionName>
    <geoplugin_currencyCode>USD</geoplugin_currencyCode>
    <geoplugin_currencySymbol>&#36;</geoplugin_currencySymbol>
    <geoplugin_currencyConverter>1</geoplugin_currencyConverter>
</geoPlugin>

Если вы видите geoplugin_city и т. д. Я хочу загрузить эти значения в php

$location = 'http://www.geoplugin.net/xml.gp?ip='.$_SERVER['REMOTE_ADDR'];
$xml = simplexml_load_file($location);

, что не сработало. Пожалуйста, помогите мне.

opps php iment xml

0
задан Mustafa M Jalal 3 April 2012 в 18:08
поделиться