1. 程式人生 > >isset empty

isset empty

span code nbsp bsp pan null emp col isset

<?php
$a=null;
$b=‘‘;
echo (isset($a))?"OK":"NG";
echo ‘<br>‘;
echo (!empty($a))?"OK":"NG";
echo ‘<hr>‘;
echo (isset($b))?"OK":"NG";
echo ‘<br>‘;
echo (!empty($b))?"OK":"NG";
echo ‘<br>‘;
/*
NG
NG
OK
NG
*/
?>

isset empty