Home  >  Article  >  php教程  >  一段简单又实用的PHP获取RSS订阅代码

一段简单又实用的PHP获取RSS订阅代码

PHP中文网
PHP中文网Original
2016-05-25 17:13:241322browse

一段简单又实用的PHP获取RSS订阅代码,比较基础,在代码基础上自行编写样式,即可!  

<?php
$rss=simplexml_load_file(&#39;http://meego123.net/rss.php&#39;);?>
<?php foreach($rss->channel->item as $item){?>
<h1><a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a></h1>
<?php echo"<p>". $item->description ."</p>";}
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn