The difference between 0 and empty in php_PHP tutorial

WBOY
Release: 2016-07-13 10:31:29
Original
1030 people have browsed it

As a qualified PHP programmer, you must know some basic knowledge, such as the difference between 0 and null. Regarding this difference, the following is a simple analysis through several examples. The truth is only It can be understood but cannot be expressed in words. Readers can slowly understand it by themselves.

<?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即为空'; //不被输出
}

?>
Copy after login

Articles you may be interested in

  • The usage and difference of using break, continue, goto, return, exit to break out of multiple loops in PHP
  • Variables in PHP The difference between adding the static keyword before the function
  • Usage and difference of echo, print, print_r, var_export, var_dump in php
  • Detailed explanation of the difference between empty, is_null and isset in php
  • The difference between execute and query methods in ThinkPHP
  • The difference and usage of return and exit, break and contiue in PHP
  • The difference between PHP merge array + and array_merge
  • http The difference between synchronous requests and asynchronous requests in requests

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764081.htmlTechArticleAs a qualified PHP programmer, you must know some basic knowledge, such as the difference between 0 and null. Regarding this difference, let’s conduct a simple analysis through several examples, among which...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template