Jump to content

getting rid of unwanted info


foucquet

Recommended Posts

I am parsing an rss feed from my flickr photostream using this:-

<?php

$url = "http://api.flickr.com/services/feeds/photos_public.gne?id=49466419@N05&lang=en-us&format=rss_200";
$rss = simplexml_load_file($url);
	if($rss)
	{
	echo '<h1>'.$rss->channel->title.'</h1>';
	echo '<li>'.$rss->channel->pubDate.'</li>';
	$items = $rss->channel->item;
		foreach($items as $item)
		{
		$title = $item->title;
		$link = $item->link;
		$published_on = $item->pubDate;
		$description = $item->description;
		echo '<h3><a href="'.$link.'">'.$title.'</a></h3>';
		echo '<span>('.$published_on.')</span>';
		echo '<p>'.$description.'</p>';
	}
}

?>

which gives me this as the description for each image:-

public 'description' => string '
<p><a href="http://www.flickr.com/people/alfthomas/">Alf Thomas</a> posted a photo:</p>
	
<p><a href="http://www.flickr.com/photos/alfthomas/14064465890/" title="harlaw_12">
<img src="http://farm6.staticflickr.com/5077/14064465890_83c02ecec6_m.jpg" width="240" height="110" alt="harlaw_12" />
</a>
</p>

<p>A view of Harlaw Reservoir.</p>' (length=338)

What I actually want is the photo (linked back) without the "Alf Thomas posted a photo" bit, does anyone have any idea how I would go about cloning that bit out?

Link to comment
https://forums.phpfreaks.com/topic/288898-getting-rid-of-unwanted-info/
Share on other sites

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.