Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:32:23+00:00 2026-06-01T05:32:23+00:00

I want to load the inside values from this xml code: <?xml version=1.0 encoding=UTF-8?>

  • 0

I want to load the inside values from this xml code:

    <?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>

If you can see the geoplugin_city, etc
I want to load these values to php

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

that didn’t work.
please help me out.

opps php i ment xml

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:32:25+00:00Added an answer on June 1, 2026 at 5:32 am

    Change your code to this first

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

    After that, make a Foreach loop to have all the data from that.

    foreach ($xml as $keys => $values) {
         $data[] = $values; // $data array have all your data independently.
    }
    

    Now, print the array and test the values.

    echo "<pre>"; print_r($data); echo "</pre>";
    

    However, try for dumping the variables so you will get the data types too..

    var_dump($xml);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file formatted like this: <?xml version=1.0 encoding=utf-8?> <Snippets> <Snippet name=abc>
I want to load key/values configuration pairs stored in XML file. To bind a
I want to load the image URL from my NSMutableArray. Here is my Code:
I want to load external websites inside div and make it a bit smaller
I want to load defined folders into my website from same system, now I
I want to load some helper in a model. How to do this? Tried
i'm trying hard to load comboBox items from an xml file. Here is my
I have a grid which load it's content from xml string (editurl: clientArray,datatype: 'xmlstring').
I want to be able to call a function from a link (this function
I want to include a large look-up table (100,000 of 3-byte values) inside a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.