php从内容中提取字符,$data['content'],表单提交的内容。
$description = html_entity_decode($data['content']);
$description = strip_tags($description);
$description = str_replace(" ", "",$description);
$description = intercept($description,0,125);
用过的字符处理函数:
PHP html_entity_decode()函数:把 HTML 实体转换为字符。
PHP strip_tags()函数:剥去字符串中的 HTML 标签。
PHP str_replace()函数:字符串替换函数。
自定义字符串截取函数,intercept(),第一个参数文本内容,第二个参数:截取开始位置,第三个参数:截取长度。
发表评论 取消回复