Blogger Information
Blog 250
fans 3
comment 0
visits 321600
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
正则表达式函数:preg_split
梁凯达的博客
Original
1235 people have browsed it

//explode()
 //函数用于字符串分割并返回新的数组
 //第一个参数:用什么来分割数组
 //第二个参数 要分割的字符串
 //返回值是新的数组

实例

$str = '广州徐静事件引1起了大家的共鸣';
	$result = explode('1',$str);
	var_dump($result);

运行实例 »

点击 "运行实例" 按钮查看在线实例

//implode()
 //函数用于将数组组合成为字符串
 //参数exlolde('分割别致','数组');

实例

$str1 = implode(',',$result);
	echo $str1;
	//join是implode()的别名
	$str1 = join(',',$result);
	echo $str1;

运行实例 »

点击 "运行实例" 按钮查看在线实例

 //$preg_split
 //函数用于将正则表达式分割成为数组
 //参数:$preg_split([正则变量],[字符串])
 //返回值:返回一个新数组

实例

$str_1 = 'qwoi1dn1qw1oxu1qiw1dqwnloih';
	$preg = '/\d/';
	$result = preg_split($preg,$str_1);
	var_dump($result);

运行实例 »

点击 "运行实例" 按钮查看在线实例

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post