php常用字符串函数

strlen() 返回字符串长度;

strpos() 返回第一个匹配的字符位置;

explode() 把字符串转化成数组;

md5() 加密;

trim() 去掉两端的指定字符;

ltrim() 去掉左边的指定字符;

rtrim() 去掉右边的指定字符;

str_pepeat() 重复字符串;

str_replace() 替换字符串;

substr() 截取字符串;

ucfirst() 把字符串的首个字母转化成大写;

ucwords() 把字符串的每个单词的首字母转化成大写;

strtolower() 把字符串转化成小写字母;

strtoupper() 把字符串转化成大写字母;

原文地址:https://www.cnblogs.com/duleilei/p/10444530.html