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 8425307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:14:05+00:00 2026-06-10T04:14:05+00:00

I have a DomDocument , which is impossible to var_dump (it really makes me

  • 0

I have a DomDocument, which is impossible to var_dump (it really makes me angry) on which I do :

var_dump($dom->getElementsByTagName('url'));

on a response like this :

<?xml version="1.0" ?>
<rss version="2.0">
  <channel>
      <url>beaute-mode/cheveux/11460--choisir-un-headband</url>
      <title>get_url_article</title>
      <host>myhost</host>
  </channel>
</rss> 

But I got the var_dump echoing : object(DOMNodeList)[262] instead of my raw data (which is an URL).

So my question is pretty simple but how do I get my raw data without being encapsulated in an DomNodeList ?

thanks.

  • 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-10T04:14:07+00:00Added an answer on June 10, 2026 at 4:14 am

    DOMNodeList::item() will give a DOMNode in the DOMNodeList by index. For example, to get the first node in the list:

    $dom->getElementsByTagName('url')->item(0)
    

    To get the actual data that the element contains, use code something like this:

    if ($node = $dom->getElementsByTagName('url')->item(0)) {
      $url = $node->nodeValue;
    } else {
      // Element does not exist, handle error here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i have a code like this: $doc = new DOMDocument(); $doc->Load('courses.xml'); foreach ($doc->getElementsByTagName('courses')
I have the following code which generates XML: $dom = new DomDocument('1.0'); ...snip adding
So I have a DOM document that looks essentially like this <categories> <category id=1/>
this is my situation: I have two org.w3c.dom.Document created from two xml files. What
I'm using PHP5 to create XML files. I have code like this: $doc =
I have this peace of code $doc = new DOMDocument(); $doc->loadHTML($article_header); $imgs = $doc->getElementsByTagName('img');
I have a webbrowser control which I navigate to an URL that contains this
I have this project i'm working on and id like to add a really
I have code which add item like below to xml file: <newWord> <Heb>rer</Heb> <Eng>twew</Eng>
have written this little class, which generates a UUID every time an object of

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.