Jump to content

Separating data in <title> of xml feed to display separately. Would substr work?


AshleyQuick

Recommended Posts

I sorta understand this. Because all the numbers in my example above ... 1 through 25 ... have a semicolon after them, can substr look for the first semicolon, grab it AND the numbers (1-25) before it and subsequently display them in the preceding div? Ideally, it would be nice to remove the semicolon altogether but that's not a necessity...

 

<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0">

  <channel>

    <title>Billboard Christian Songs Chart</title>

    <link>http://www.billboard.com/</link>

    <description />

    <item>

      <title>1: All Of Creation, MercyMe</title>

      <link>http://www.billboard.com/charts/christian-songs</link>

      <description>All Of Creation by MercyMe ranks #1</description>

      <category>Christian Songs</category>

      <pubDate>Sat, 01 May 2010 04:00:00 GMT</pubDate>

      <guid isPermaLink="false">2010-05-01 00:00:00.0-10549440</guid>

    </item>

 

  </channel>

</rss>

 

 

Because all the numbers in my example above ... 1 through 25 ... have a semicolon after them, can substr look for the first semicolon, grab it AND the numbers (1-25) before it and subsequently display them in the preceding div? Ideally, it would be nice to remove the semicolon altogether but that's not a necessity...

 

 

echo "<div>The number would be moved to this div.</div>";

echo "<div>";
    echo htmlentities($item['title']);
echo "</div>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.