- define: documentation ( source)
- printf: documentation ( source)
<?php
if ( ! defined('PHP_EOL')) {
define('PHP_EOL', "\n");
}
$array = array('a' => false, 'b' => null, 'c' => '', 'd' => true);
function asBool($value) {
return $value ? 'true' : 'false' ;
}
foreach ($array as $k => $v) {
printf(
'"%s" => "%s" isset = %s ake = %s' . PHP_EOL,
$k, $v,
asBool(isset($array[ $k ])),
asBool(array_key_exists($k, $array))
);
}