<?php
//预定义变量数组:空字符,字符0,数组0,null,布尔false,空数组$arr_var = array('', '0', 0, null, false, array());foreach ($arr_var as $value) {
echo '<br>传入值为:' . $value . '<br>'; if (!isset($value)) { echo 'isset()==false<br>'; } if (empty($value)) { echo 'empty()==true<br>'; } if (!$value) { echo 'self==false<br>'; } if (is_null($value)) { echo 'is_null()==true<br>'; }}?>输出结果:传入值为:
empty()==trueself==false传入值为:0
empty()==trueself==false传入值为:0
empty()==trueself==false传入值为:
isset()==falseempty()==trueself==falseis_null()==true传入值为:
empty()==trueself==false传入值为:Array
empty()==trueself==false