array_filter 过滤一维中空数组,数组的序列不变
2017-10-30 11:08
183 查看
<?php header('Content-type:text;charset=utf8'); $str = "%11111%22222%333333%"; $arr = explode('%',$str); print_r($arr); print_r(array_filter($arr)); ?>
--------------------------------------------------
Array ( [0] => [1] => 11111 [2] => 22222 [3] => 333333 [4] => ) Array ( [1] => 11111 [2] => 22222 [3] => 333333 )
相关文章推荐
- 过滤数组中的空数组array_filter()
- php-Arrays 函数-array_filter-用回调函数过滤数组中的单元
- php中的常用数组函数(二)(数组元素过滤 array_filter())
- php中使用array_filter()函数过滤空数组的实现代码
- 用回调函数过滤数组中的元素[array_filter]
- php中使用array_filter()函数过滤空数组的实现代码
- IOS 根据对象属性值过滤数组中的元素 Filter NSMutableArray with object property
- array_filter() 过滤数组中的空白元素
- 使用 unset 和 array_filter 过滤多维数组
- 剔除空数组 array_filter()
- php数组函数序列之array_unique() - 去除数组中重复的元素值
- php数组函数序列 之shuffle()和array_rand() 随机函数使用介绍
- php数组函数序列之array_pop() - 删除数组中的最后一个元素
- 一维数组中最长递增子序列的长度(DP做法)
- 5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例
- 5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例(转)
- 5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例
- php数组函数序列之array_combine() - 数组合并函数使用说明
- php数组函数序列之array_sum() - 计算数组元素值之和
- php数组函数序列之array_slice() - 在数组中根据条件取出一段值,并返回