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

  • Home
  • SEARCH
  • 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 7873043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:23:44+00:00 2026-06-03T02:23:44+00:00

i hv a xml file,how to get values in title field using get file

  • 0

i hv a xml file,how to get values in title field using get file content method..i just want to get the value “TomTom XXL 550M – US, Canada & Mexico Automotive GPS. (Brand New)”

<Title>
TomTom XXL 550M - US, Canada & Mexico Automotive GPS. (Brand New)
</Title>

my code

$xmlstr = file_get_contents($source);
$parseXML = new SimpleXMLElement($xmlstr);
print($parseXML);

// load as file
$parseXMLFile = new SimpleXMLElement($source,null,true);
  • 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-03T02:23:45+00:00Added an answer on June 3, 2026 at 2:23 am

    If you feel confortable with javascript, there is another solution called DOMDocument

    You can load XML files and also use function like getElementsByTagName. For example, if you have a books.xml file like this:

    <?xml version="1.0" encoding="utf-8"?>
    <books>
     <book><title>Patterns of Enterprise Application Architecture</title></book>
     <book><title>Design Patterns: Elements of Reusable Software Design</title></book>
     <book><title>Clean Code</title></book>
    </books>
    

    You can extract titles so:

    $dom = new DOMDocument;
    $dom->load('books.xml');
    $books = $dom->getElementsByTagName('title');
    foreach ($books as $book) {
        echo $book->nodeValue.'<br>';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get the CreateDate value from xml file the xml file is
How can I get the connection.connection_string value from the following hibernate xml file using
I am loading an XML file using jQuery $.get. after loading the content, i
I want to parse the following xml and get the value of metadata:description using
I want to get values under specific tags of my xml file (accessed via
I have this xml file and I want to get some values with Xpath.
I'm using cURL to get the XML file for my Twitter friend's timeline. (API
I am trying to extract values from an XML file using linq to create
With this code I can get the title out of the following XML file:
I am calling oracle package, to get xml file from the package into oracleDataReader.

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.