Your Ad Here

Thursday, March 26, 2009

When echoing a variable it displays literally

Code:
---------
echo '

$title
';
---------
When I use this bit of code it displays the title as literally "$title" which is obviously not what I'm trying to do. I would like it to display the variable of the title. Here's the code that I'm working with in it's entirety [Note - I'm working with Magpie RSS]:


Code:
---------
$rss = fetch_rss('http://sports.espn.go.com/espn/rss/news');

$items = array_slice($rss->items, 0, 5);
foreach ($items as $item) {
$href = $item['link'];
$title = $item['title'];
$desc = $item['description'];
echo '

$title
';
if($desc) echo $desc;
}?>
---------


Read More...

Your Ad Here

No comments: