例:substr('php is very good language',4,5);

輸出為 is ve;

當start>str的長度,則返回為();

substr('php is very good language',26,5);

substr('php is very good lang " /> 色综合色综合网色综合,久久综合伊人77777蜜臀,国产精品av一区二区

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

學習php筆記 字符串處理

substr();

substr(str,start,length);

例:substr('php is very good language',4,5);

輸出為 is ve;

當start>str的長度,則返回為();

substr('php is very good language',26,5);

substr('php is very good language',4);

輸出為 (空白)

輸出為is v (表明start和langth都為4)

當start為負值,則從str末尾出開始讀起(*這時是從-1開始讀,而不是從0開始),

substr('php is very good language',-4,5);

輸出為uage

當length為負值時,length代表的是從末尾開始讀,截取str的結束位置。

substr('php is very good language',4,-5);

輸出為is very good lan

explode()把函數字符串分割為數組;

strrev()把函數字符串

setlocalhost(content location)設置本地環境.content ,指定需要設置的場景信息常量有(

LC_ALL 主站蜘蛛池模板: 常熟市| 乡城县| 贵州省| 巨鹿县| 丰县| 波密县| 全椒县| 青神县| 新竹市| 衡阳市| 犍为县| 江门市| 拉萨市| 鹤峰县| 汤阴县| 舒城县| 金华市| 贺兰县| 中江县| 柳河县| 镇巴县| 特克斯县| 永安市| 泸州市| 华池县| 肥东县| 中方县| 徐水县| 保定市| 如东县| 抚远县| 紫金县| 庆安县| 绥化市| 油尖旺区| 融水| 永兴县| 讷河市| 神农架林区| 临夏市| 敦化市|