Source Code:
(back to article)
<?php $var1 = ""; $var2 = "hello"; $var3 = null; $var4 = 0; $var5 = "0"; $var6 = array(); echo empty($var1) . "\n"; // output: 1 (true) echo empty($var2) . "\n"; // output: 0 (false) echo empty($var3) . "\n"; // output: 1 (true) echo empty($var4) . "\n"; // output: 1 (true) echo empty($var5) . "\n"; // output: 1 (true) echo empty($var6) . "\n"; // output: 1 (true) ?>
Result:
Report an issue