字符串的常用函数

trim –去除字符串首尾的空白字符(或者其他字符)

strlen –字符串长度

substr –截取字符串

str_replace –替换字符串函数

substr_replace –对指定字符串中的部分字符串进行替换

strstr –检索字符串函数

explode –分割字符串函数

implode –将数组合并成字符串

str_repeat –重复一个字符串

addslashes –转义字符串

htmlspecialchars –html实体转义

原文地址:https://www.cnblogs.com/xiaolongphp/p/4752278.html