string htmlentities ( string $string [, int $flags=ENT_COMPAT | ENT_HTML401 [, string $encoding=ini_get("default_charset") [, bool $double_encode=true ]]] )
它用于将所有适用的字符转换为HTML实体
Sr.No | 参数 & Description |
---|---|
1 |
string 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-htmlentities.html 来源:LearnFk无涯教程网 它包含有关输入字符串的信息 |
2 |
flags 它包含有关标志的信息 |
3 |
encoding 它是一个可选参数,定义转换字符时使用的编码。 |
它返回编码的字符串。
<?php $str="PHP Function htmlentities"; echo htmlentities($str); echo htmlentities($str, ENT_QUOTES); ?>
这将产生以下输出--
PHP Function htmlentitiesPHP Function htmlentities
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)