php man page for boolval

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 variable

SYNOPSIS
boolean boolval (mixed $var)
DESCRIPTION
Returns the boolean value of $var.
PARAMETERS
o $var - The scalar value being converted to a boolean.
RETURN VALUES
The boolean value of $var.
EXAMPLES
Example #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: true
SEE ALSO
floatval(3), intval(3), strval(3), settype(3), is_bool(3), Type juggling. PHP Documentation Group BOOLVAL(3)
Related Man Pages
use_env(3xcurses) - sunos
locale_filter_matches(3) - php
intval(3) - php
gearman_job_status(3) - php
is_float(3) - php
Similar Topics in the Unix Linux Community
Trouble with tr
Efficiently Repeat Text
Some one look into this
Simplest way to format with If on stout?
If echo statement return false