//截取字符串
mb_substr($str,star,count,encode);
//获取字符串长度
mb_strlen();
//完整保留在textarea文本中的回车换行
str_replace(chr(10),"
",$textarea);
//根据ascii返回相应的字母
echo "ascii为66的字母是:". chr(66)."
";
//chop 去除字符串中的连续空格和空白
$str=" he llo wo rd ";echo "s:";
echo "s:".chop($str)."w";
//explode 按照某个字符分割字符串 返回数组
$str="green,red,yellow,white";
$arr=explode(" ",$str);echo "分割后的数组是:";
print_r($arr);
//implode 将数组按照某个字符拼成字符串
$arr=array("a","b","c","d");
$str=implode('/',$arr);
echo "
拼成的字符串是:".$str;
//打印print
print("打印的方法print");
echo "格式化打印printf:
";
printf("%f%",2,"d");
//不区分大小写比较字符串
echo "不区分大小写:".strcasecmp("hello word","hello word");
//区分大小写
echo "区分大小写:". strcmp("hello word","hello word");
//查找字符串
echo "查找的结果是:". strchr("hello word","hello");
//字符串长度
echo "str长度:".strlen("hello word");
//将字符串重复几次str_repeat
echo "将字符串重复几次:".str_repeat("ws",3);
//将字符串倒序排列
echo "zifuchuandaoxu:".strrev("zifuchuandaoxu");
//将字符串大写,小写转化
//strtolower();
//strtoupper();
//字符串替换,
echo "替换后的字符串是:". str_replace("b","*","aaaaabbbbbccccc");
//切割字符串
echo "切割后的字符串是:". substr("hello word",2,3);