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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:36:16+00:00 2026-06-07T09:36:16+00:00

I’m trying to echo the text that is in between the quotes in <head_1

  • 0

I’m trying to echo the text that is in between the quotes in <head_1 data="Superhero"/>

The XML file looks like:

<?xml version="1.0"?>
<nowplaying version="1.1">
    <playing_now>
        <rbds_text data="SUPERHERO by Family Force 5"/>
        <result>
            <type data="song"/>
            <head_1 data="Superhero"/>
            <head_2 data="Family Force 5"/>
            <head_url data="song/Family_Force_5/Superhero.html"/>
            <foot_1 data="III.V - EP"/>
            <foot_2 data="Family Force 5"/>
            <foot_url data="album/Family_Force_5/III.V_-_EP.html"/>
            <image_50 data="/images/music/thumbs/familyforce5-iiivep.jpg"/>
            <image_200 data="/images/music/familyforce5-iiivep.jpg"/>
        </result>
    </playing_now>
</nowplaying>

My current PHP file looks like this, but I’m getting an error:

<?php
include 'playing-now/api.html';

$nowplaying = new SimpleXMLElement($xmlstr);

echo $nowplaying->playing_now->result->head_1;"
?>
  • 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-07T09:36:17+00:00Added an answer on June 7, 2026 at 9:36 am
    echo $nowplaying->playing_now->result->head_1['data'];
    

    If you’re getting any errors, it might be on the names. You should be able to escape them like this:

    echo $nowplaying->{'playing_now'}->result->{'head_1'}['data'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to create an if statement in PHP that prevents a single post

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.