无涯教程-PHP - html special chars decode函数

67 阅读1分钟

html special chars decode - 语法

string htmlspecialchars_decode ( string $string [, int $flags=ENT_COMPAT | ENT_HTML401 ] )

它用于将特殊的HTML实体转换回字符。

Sr.No 参数 & Description
1

string

它包含有关输入字符串的信息

2

flags

它包含有关标志的信息

html special chars decode - 返回值

它返回解码后的字符串。

html special chars decode - 示例

<?php
   $str="<p>tutorials -> </p>\n";
   
   echo htmlspecialchars_decode($str);
?>

这将产生以下输出--

tutorials -> "

参考链接

www.learnfk.com/php/php-fun…