Home > php教程 > php手册 > php array_filter除去数组中的空字符元素

php array_filter除去数组中的空字符元素

WBOY
Release: 2016-06-13 12:04:21
Original
1158 people have browsed it

除去数组中的空字符元素

复制代码 代码如下:


$str1_array=array('脚本之家','','http://www.jb51.net','','1654','');
$str1_array=array_filter($str1_array);
print_r($str1_array);
?>


显示结果:

复制代码 代码如下:


Array
(
[0] => 脚本之家
[2] => http://www.jb51.net
[4] => 1654
)

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template