Posts Tagged ‘php echo’

Why doesnt this script work? It uses php in an XML file to display RSS feeds?

Hi, i made this script, its supposed to show rss feeds in xml. I saved the file as .php so that the php statements are shown. But why don’t they show? They show in normal file so why not in this? It should create then show the value "hello" in the text.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0"><channel>
<item>
<title><?php $i = "hello"; echo "$i"; ?></title>
<description>Police <?php echo "$i"; ?>confirm a body found inside a Glasgow church is that of missing Polish student Angelika Kluk, as a 60-year-old man is arrested.</description>
<link>http://news.bbc.co.uk/go/rss/-/1/hi/scotland/glasgow_and_west/5396272.stm</link>

<guid isPermaLink="false">http://news.bbc.co.uk/1/hi/scotland/glasgow_and_west/5396272.stm</guid>
<pubDate>Sun, 01 Oct 2006 09:23:50 GMT</pubDate>
<category>Glasgow and West</category>
</item>
</channel>
</rss>

Can PHP be used in RSS XML files? (E.g. a varible as the description?

Can php be used in a xml file for displaying RSS feeds?
For example:
$variable = "Description text"
<description><php? echo $variable ?></description>
Would this work? using a varible to display the text on the feeds?
If not is there another way to use it?