doushifang4382 2012-11-16 17:19
浏览 26
已采纳

使用PHP的XML RSS提要

I'm using the following code to piece together a series of variables declared further back in the script to form the link portion of a RSS XML feed. I need to insert a ampersand between the variables to complete the URL properly. I've tried using & and also just & put it ends up with an error:

error on line 7 at column 194: Entity Ref: expecting ';'

Can somebody please show me so I can see what I am doing wrong?

echo '<link>' . $url . 'ampersand_goes_here' . $mlcall. '' . $title . '</link>';
  • 写回答

2条回答 默认 最新

  • douci6541 2012-11-16 17:40
    关注

    try enclosing the string within the link tag with the htmlspecialchars() function.

    echo '<link>' . htmlspecialchars($url . 'ampersand_goes_here' . $mlcall. '' . $title) . '</link>';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部