大小与转换
strtolower():字符串转成小写
strtoupper():字符串转成大写
ucfirst():字符串首字母大写
unwords():字符串每个单词首字符转成大写
html标签关联
htmlentities():把字符转为html实体
$str = "John & 'Adams'";
echo htmlentities($str, ENT_COMPAT); // John & 'Adams'
htmlspecialchars():预定义字符转成html编码
nl2br():\n转成 < br >标签
strip_tags():剥去html,xml 以及PHP标签
echo strip_tags("Hello <b>world!</b>"); //Hello world!
addcslashes:在指定的字符前添加反斜杠转义字符串中的字符
网友评论