Source Code:
(back to article)
<?php $var1 = "hello"; $var2 = 3.14; $var3 = true; $var4 = [1, 2, 3]; echo is_scalar($var1) . "\n"; // output: 1 (true) echo is_scalar($var2) . "\n"; // output: 1 (true) echo is_scalar($var3) . "\n"; // output: 1 (true) echo is_scalar($var4) . "\n"; // output: (false) ?>
Result:
Report an issue