开发者

PHP, XHTML and ampersands

开发者 https://www.devze.com 2022-12-21 16:10 出处:网络
How do I replace ampersands in a url from & > & I use some rss feeds wit开发者_运维百科ch has URL containing & should I use

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

精彩评论

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