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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:34:19+00:00 2026-06-15T20:34:19+00:00

In my php script, I try to parse a online – xml file. That´s

  • 0

In my php script, I try to parse a online – xml file.

That´s how I load it into my script:

$xml = simplexml_load_file($filename);

Now, I want to make a test output. I try it with

echo $xml->title;

but there is no result. When I try print_r($xml) I get the right XML file.
It looks like that:

<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>testtitle</title>

and so on

Why is there no result?

  • 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-15T20:34:21+00:00Added an answer on June 15, 2026 at 8:34 pm

    It is because of the nesting of the elements.

    <rss>
    -> $xml
    <channel>
    -> $xml->channel
    <title>
    -> $xml->channel->title
    

    So if u use:

    <?php
    echo  $xml->channel->title;
    ?>
    

    That will output your title

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to write a PHP script to parse an XML document using
I have a php script that will parse html page content link and view
Using PHP I'm trying to parse very large xml files and insert them into
I'm trying to parse a moderately large XML file (6mb) in php using simpleXML.
I have a large csv that I want to parse and insert into my
I try to dump my data thought php script but without command line. SO
I try to us wp_enqueue_script to load my javascript, here is my code: <?php
PHP script to read in user action requests and parse them to their components.
A php script is building the following (very complicated script that is too long
I made a little PHP script that checks if an email is valid. The

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.