As a qualified php programmer, some basic knowledge must be known, such as the difference between 0 and null. For this difference, we will perform a simple analysis using several instances, the principle can only be explained. Readers can learn it by themselves.
<? Php $ test = 0; if ($ test = '') {echo '<br/> in php, 0 is blank '; // output} if ($ test = '') {echo '<br/> in php, 0 is null '; // not output} if ($ test = NULL) {echo '<br/> in php, 0 is NULL '; // output} if ($ test = NULL) {echo '<br/> in php, 0 is NULL '; // not output} if ($ test = false) {echo '<br/> in php, 0 is null '; // output} if ($ test = false) {echo '<br/> in php, 0 is blank. // not output}?>Articles you may be interested in
- Use break, continue, goto, return, and exit in multiple loops in PHP
- Differences between variables and functions in php after the static keyword is added
- Differences between echo, print, print_r, var_export, and var_dump in php
- Empty, is_null, and isset in php
- Difference between execute and query methods in ThinkPHP
- Differences and usage of return, exit, break, and contiue in PHP
- PHP merges arrays + and array_merge
- Differences between synchronous requests and asynchronous requests in http requests