Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.