- array_filter: documentation ( source)
<?php
$cosas = array(
'true' => TRUE,
'false' => FALSE,
'null' => NULL,
'empty' => "",
'positive' => 1,
'negative' => -1,
'zero' => 0
);
$cosas = array_filter($cosas, function($k){ return TRUE; });
foreach($cosas as $nombre => $cosa)
{
echo "* $nombre\n";
echo "\tisset:\t" . ( isset($cosa) ? "TRUE" : "FALSE" ) . "\n";
echo "\ti_null:\t" . ( is_null($cosa) ? "TRUE" : "FALSE" ) . "\n";
echo "\tempty:\t" . ( empty($cosa) ? "TRUE" : "FALSE" ) . "\n";
echo "\teval:\t" . ( $cosa ? "TRUE" : "FALSE" ) . "\n\n";
}