开发者

PHP, XHTML and ampersands

How do I replace ampersands in a url from & > &

I use some rss feeds wit开发者_运维百科ch has URL containing & should I use

$link = str_replace('&', '&', $link);

or there are other options?


Use htmlspecialchars. It replaces not just & but also ", <, >, and ' (only if quote_style parameter is set to ENT_QUOTES) that all need to be replaced with appropriate character references.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜