Query: boolval
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
BOOLVAL(3) 1 BOOLVAL(3) boolval - Get the boolean value of a variableSYNOPSISboolean boolval (mixed $var)DESCRIPTIONReturns the boolean value of $var.PARAMETERSo $var - The scalar value being converted to a boolean.RETURN VALUESThe boolean value of $var.EXAMPLESExample #1 boolval(3) examples <?php echo '0: '.(boolval(0) ? 'true' : 'false')." "; echo '42: '.(boolval(42) ? 'true' : 'false')." "; echo '0.0: '.(boolval(0.0) ? 'true' : 'false')." "; echo '4.2: '.(boolval(4.2) ? 'true' : 'false')." "; echo '"": '.(boolval("") ? 'true' : 'false')." "; echo '"string": '.(boolval("string") ? 'true' : 'false')." "; echo '"0": '.(boolval("0") ? 'true' : 'false')." "; echo '"1": '.(boolval("1") ? 'true' : 'false')." "; echo '[1, 2]: '.(boolval([1, 2]) ? 'true' : 'false')." "; echo '[]: '.(boolval([]) ? 'true' : 'false')." "; echo 'stdClass: '.(boolval(new stdClass) ? 'true' : 'false')." "; ?> The above example will output: 0: false 42: true 0.0: false 4.2: true "": false "string": true "0": false "1": true [1, 2]: true []: false stdClass: trueSEE ALSOfloatval(3), intval(3), strval(3), settype(3), is_bool(3), Type juggling. PHP Documentation Group BOOLVAL(3)
Related Man Pages |
---|
boolval(3) - php |
empty(3) - php |
is_float(3) - php |
parsekit_func_arginfo(3) - php |
substr(3) - php |
Similar Topics in the Unix Linux Community |
---|
error |
How to echo the parth ? |
Replacing in SED |
Trouble with tr |
Weird Awk issue |