开发者

html source encode

开发者 https://www.devze.com 2022-12-27 08:47 出处:网络
when I view source on my php page I get " for a quote. But instead, I would like \" to be used in the source code. I have no control over manually replacing it so Im wondering if there is a f

when I view source on my php page I get " for a quote. But instead, I would like " to be used in the source code. I have no control over manually replacing it so Im wondering if there is a function to do开发者_如何学C such a thing.


If you have access to the PHP and want to change all html special characters to their rightful variations use:

print htmlspecialchars_decode($string);


You could do this very simply using str_replace.

$string = str_replace('"', '"', $string);

However, as Levi said, why not just leave it this way? It should have no effect on the display.

0

精彩评论

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

关注公众号