- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?php
$x = array(
1,
2,
true,
null, //will be removed
'', //will be removed
false, //will be removed
0, //will be removed
array(), //will be removed
'finish'
);
var_dump(array_filter($x));
var_dump(count($x));
var_dump(count(array_filter($x)));