Jump to content

xml to array


RaythMistwalker

Recommended Posts

<Response>

<Ip>127.0.0.1</Ip>

<Status>OK</Status>

<CountryCode>GB</CountryCode>

<CountryName>United Kingdom</CountryName>

<RegionCode>U8</RegionCode>

<RegionName>Region</RegionName>

<City>City</City>

<ZipPostalCode/>

<Latitude>Cords</Latitude>

<Longitude>Cords</Longitude>

<Timezone>0</Timezone>

<Gmtoffset>0</Gmtoffset>

<Dstoffset>1</Dstoffset>

</Response>

 

This gets info from http://www.ipinfodb.com/ip_query.php?ip=$ip&output=xml and i wish to save in an array called $ipinfo but still dunno howto use arrays in php and then get info from the xml file.

I have:

$ipinfo = file_get_contents("http://www.ipinfodb.com/ip_query.php?ip=$ip&output=xml");

from oni-kun and $ip is set at the beginning of the page working good. note: i don't need the IP to return from this page since i already have it.

 

Any help is appreciated

~Rayth

 

Link to comment
https://forums.phpfreaks.com/topic/187406-xml-to-array/
Share on other sites

erm what do i do about thse:

 

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /path/to/file/ipinfo.php on line 18

 

Warning: file_get_contents(http://www.ipinfodb.com/ip_query.php?ip=IPHERE&output=json) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /path/to/file/ipinfo.php on line 18

Link to comment
https://forums.phpfreaks.com/topic/187406-xml-to-array/#findComment-989653
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.