<?php class test{} $a1 = null; $a2 = ""; //$a3 = $a4 = 0; $a5 = '0'; $a6 = false; $a7 = array(); //var $a8; $a9 = new test(); for ($i=1; $i <=9 ; $i++) { $s = 'a'.$i; echo $i . ":"; var_dump(isset($$s)); echo '<br />'; } echo '<br />'; for ($i=1; $i <=9 ; $i++) { $s = 'a'.$i; echo $i . ":"; var_dump(empty($$s)); echo '<br />'; }
That’s basically it
The above introduces the PHP judgment results of empty and isset parameters, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.