Heim  >  Artikel  >  Backend-Entwicklung  >  php中0与空的区别_PHP教程

php中0与空的区别_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:31:29990Durchsuche

作为一个合格的php程序员,一些基础知识是必须要知道的,例如0和空的区别,关于这个区别,下面就通过几个实例进行简单的分析,其中的道理,只可意会,不可言传,读者可以自己去慢慢体会了。

<?php $test=0;

if($test==''){
	echo '<br />在php中,0即为空'; //被输出
}

if($test===''){
	echo '<br>在php中,0即为空'; //不被输出
}

if($test==NULL){
	echo '<br>在php中,0即为空'; //被输出
}

if($test===NULL){
	echo '<br>在php中,0即为空'; //不被输出
}

if($test==false){
	echo '<br>在php中,0即为空'; //被输出
}

if($test===false){
	echo '<br>在php中,0即为空'; //不被输出
}

?>

您可能感兴趣的文章

  • PHP中跳出多重循环使用break,continue,goto,return,exit的用法和区别
  • php中在变量和函数前加static关键字之后的区别
  • php中echo,print,print_r,var_export,var_dump 的用法与区别
  • php中empty,is_null,isset的区别详解
  • ThinkPHP中execute和query方法的区别
  • PHP中return 和 exit 、break和contiue 区别与用法
  • PHP合并数组+与array_merge的区别
  • http请求中同步请求和异步请求的区别

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/764081.htmlTechArticle作为一个合格的php程序员,一些基础知识是必须要知道的,例如0和空的区别,关于这个区别,下面就通过几个实例进行简单的分析,其中的...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn