前端之家收集整理的这篇文章主要介绍了
php – 限制包含HTML标记的文本的输入长度,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
html_entity_decode仅解码HTML实体,它不会忽略HTML
标记.尝试:
strlen(strip_tags(html_entity_decode($string)));
@H_
403_1@或者多字节等价物:
mb_strlen(strip_tags(html_entity_decode($string)),'auto');