note 94862 added to simplexml.examples-basic
| From: | SmartLook at osu1 dot php dot net | Date: | Sun, 29 Nov 2009 19:03:54 +0000 |
| Subject: | note 94862 added to simplexml.examples-basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163384@lists.php.net to get a copy of this message | ||
<?php
/*
* A very basic example of reading Blogger RSS
*/
$url = "http://www.smartlook.com/feeds/posts/default?alt=rss";
$xml = new SimpleXMLElement( file_get_contents( $url ) );
for ( $PostNum = 0; $PostNum < 5; $PostNum++ ) {
$oPost = $xml->channel->item[$PostNum];
?>
<a href="<?php print $oPost->link; ?>"><?php
print htmlentities( $oPost->title, ENT_COMPAT, 'UTF-8' ); ?></a>
<br>
<?php
}
/*
AN OUTPUT LINE (url truncated to fit here):
<a href="http://www.smartlook.com/">
Modern Dining Room Interior with Ballet Artworks</a>
<br>
*/
?>
----
Server IP: 69.147.83.197
Probable Submitter: 69.171.128.185
----
Manual Page -- http://www.php.net/manual/en/simplexml.examples-basic.php
Edit -- https://master.php.net/note/edit/94862
Del: integrated -- https://master.php.net/note/delete/94862/integrated
Del: useless -- https://master.php.net/note/delete/94862/useless
Del: bad code -- https://master.php.net/note/delete/94862/bad+code
Del: spam -- https://master.php.net/note/delete/94862/spam
Del: non-english -- https://master.php.net/note/delete/94862/non-english
Del: in docs -- https://master.php.net/note/delete/94862/in+docs
Del: other reasons-- https://master.php.net/note/delete/94862
Reject -- https://master.php.net/note/reject/94862
Search -- https://master.php.net/manage/user-notes.php