php,JS 判断条件为空时

2016-5-23 admin PHP

$re = '';

 

if($re) == false;

 

$re = '11';

 

 

if($re) == true; 

 

 

 

php里转换成json的结果为null是 不是布尔值的null 而是 String的 null



if(''){
alert('true');
}else{
alert('false');
}


// 结果是false

发表评论:

Powered by emlog 吉ICP备15003877号