简体   繁体   English

如何从链接获取RSS信息并将其打印在PHP / HTML页面中?

[英]How to get RSS info from link and print it in PHP/HTML page?

I have never worked before with RSS. 我以前从未使用过RSS。

I have tried to print it with <iframe> but it was a silly try. 我尝试使用<iframe>打印它,但这是一个愚蠢的尝试。

I am well familiar with PHP/CSS/HTML and I want to know how I can print the RSS info in HTML/PHP page from this RSS link: 我对PHP / CSS / HTML非常熟悉,我想知道如何从此RSS链接打印HTML / PHP页面中的RSS信息:

http://grabo.bg/rss/?city=&affid=16090

Do i need any parser or something? 我需要解析器或其他东西吗? Please tell me how I can print this content in html form? 请告诉我如何以html格式打印此内容?

What i have to know about RSS? 我对RSS有什么了解?

it is just xml. 它只是xml。 All you have to do is curl that page or: 您要做的就是卷曲该页面或:

$feed = file_get_contents('http://grabo.bg/rss/?city=&affid=16090');

And after that to say: 然后说:

$rss = simplexml_load_string($feed);

and then say 然后说

foreach($rss as $r){

//in your case
echo $r->title;
echo $r->content;

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM