简体   繁体   English

simplepie get_permalink不会返回整个href

[英]simplepie get_permalink won't returne whole href

This works fine and returns the item permalink 这可以正常工作并返回项目永久链接

$item->get_permalink()

But if I want to return the whole url the code below will return the feed url instead of the item permalink. 但是,如果我想返回整个网址,则下面的代码将返回供稿网址,而不是项目永久链接。

What is wrong with this code below? 下面的代码有什么问题? Why it doesn't return the whole href? 为什么不返回整个href?

$link ='<a href=".$item->get_permalink()."></a>';

Thanks 谢谢

$link ="<a href=\"$item->get_permalink()\"></a>";

or 要么

$link ='<a href="'.$item->get_permalink().'"></a>';

instead of 代替

$link ='<a href=".$item->get_permalink()."></a>';

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

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