php中0和‘0’转换为布尔值都是false,js中除了空字符串('')其它都是true <?php $a = '0'; if($a == false){ echo 1; }else{ echo 2; }