Blogger Information
Blog 250
fans 3
comment 0
visits 323133
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
数组分割函数:str_split(),explode(),implode()
梁凯达的博客
Original
1356 people have browsed it

实例

<?php
 //字符串转数组
 //函数
 //str_split($str,$length)
 $str = '这,个,是,一,个,字,符,串';
 var_dump(str_split($str,3));
 //函数
 //explode('标志','字符串');
 //函数作用:将字符串内的标志进行分割,分割成为一个数组
 var_dump(explode(',',$str));
 $arr = explode(',',$str);

 //函数
 //implode('标志','数组');
 //函数作用:将字符串内的标志进行粘合,粘合成为一个字符串

 var_dump(implode(',', $arr));

运行实例 »

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

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