Source Code:
(back to article)
<?php $var1 = ["apple", "banana", "orange"]; $var2 = "hello"; $var3 = new stdClass(); $var4 = 42; echo is_countable($var1) . "\n"; // output: 1 (true) echo is_countable($var2) . "\n"; // output: 0 (false) echo is_countable($var3) . "\n"; // output: 0 (false) echo is_countable($var4) . "\n"; // output: 0 (false) ?>
Result:
Report an issue