最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php explode split str_split函数区别与实例
时间:2022-06-24 21:45:17 编辑:袖梨 来源:一聚教程网
三个函数都是把一个字符串分割成一个数组,但各有各的用法,下面我们就一一来看关于php explode split str_split函数区别与实例吧。
*/
$str ="id_99_cn.html";
$array = explode('_',$str);
print_r($array);
/*
array
(
[0] => id
[1] => 99
[2] => cn.html
)
*/
//函数原型:array split (string $pattern, string $string [, int $limit])
$split = split('_',$str);
print_r($split);
/*
array
(
[0] => id
[1] => 99
[2] => cn.html
)
*/
//str_split() 函数的字符串分割成一个数组。
$str_split = str_split($str,2);
print_r($str_split);
/*
array
(
[0] => id
[1] => _9
[2] => 9_
[3] => cn
[4] => .h
[5] => tm
[6] => l
)
本站原创文章转载注明来源于http://www.111com.net
相关文章
- 火影忍者怎么获得大招 05-03
- 星际战甲新手什么刀好 05-03
- 文明6秦始皇金字塔怎么加速 05-03
- 全民奇迹2龙骸巨剑怎么获得 05-03
- 星露谷物语鲟鱼怎么获得 05-03
- 长安幻想怎么转职 05-03