首页 > 代码库 > isset empty

isset empty

<?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