Next we will introduce you to the difference between Null and 0 values in php, which may be commonly used for fuzzy analysis. here are a few examples. let's take a closer look. The PHP instance code is as follows :? Php $ test0;... the following section describes the differences between Null and 0 values in php, which may be commonly used for fuzzy analysis. Here are several examples. let's take a closer look.
The PHP instance code is as follows:
In php, 0 is null; // output} if ($ test = '') {echo'
In php, 0 is NULL; // not output} if ($ test = NULL) {echo'
In php, 0 is NULL; // output} if ($ test = NULL) {echo'
In php, 0 is null; // not output} if ($ test = false) {echo'
In php, 0 is null; // output} if ($ test = false) {echo'
In php, 0 is null; // no output}?>
It can be seen from the above that when it is null, it is equal to 0 or null, but if it is an exact comparison, we will find that 0 and null are compared by character, so it won't be, if it is a normal comparison, it is a logical false comparison. here we can see that 0 = false, null = false, ''= false.
Tutorial link:
Reprint at will ~ However, please keep the tutorial address★