|
|
array_filter function in php - PHP
|
Views : 180
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Suppose we have an array $a like this
Array ( [0] => abc [1] => dcf [2] => [3] => [4] => [5] => )
Here we need to check whether the array element is empty and pop that element.
We can easily achieve this by array_filter()
print_r(array_filter($a));
The output will be
Array ( [0] => abc [1] => dcf )
We can also write call back functions that can be passed as a parameter to array_filter() function.
|
|
By banumathi, On - 2011-08-30 |
|
|
|