The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to display text from XML between special characters

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #198267

    I am trying to display text from an XML file that is surrounded by special characters. I can get everything in the tag to display with simpleXML. It contains content that is unneeded.

    <Song id=”1″>Wed 01:49PM M7572|I AM YOURS|THE AFTERS|327</Song>

    As in the above code example, I am trying to get the song title and artist (Title: I AM YOURS, Artist: THE AFTERS). This is dynamically generated content from an RDS system at a radio station. So I can’t change the format of the XML file.

    Any help would be great. Thanks


    If the format is always Date|Title|Artist|? then if you are already getting the tag’s content you could do the following:

    list($date, $title, $artist, $something) = explode("|", $content);

    I think you’ve already spotted this, but using those sorts of delimiters is just redundant with XML, though.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.