Home >Backend Development >PHP Tutorial >PHP经常用到的数组操作小函数

PHP经常用到的数组操作小函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-19 12:16:011215browse
$str = '数组1,数组2,数组3,数组4';
$array = explode(',',$str); //将规律字符串存入数组
$array = array_diff($array,array('数组2')); //删除指定值的数组项
$str = implode(',',$array); //将数组存为规律字符串
echo $str;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn