PHP boolval() Function

Facebooktwitterredditpinterestlinkedinmailby feather

PHP boolval() Function

The boolval() function in PHP is used to give the Boolean value for a given variable.

Syntax

Parameter

var(required)– This parameter represents the value that is converted to a boolean. It can be a string type, integer type etc.

Return

This function returns the boolean value for the parameter var. The Boolean value is evaluated based on the following conditions:

  • if $var is evaluated to boolean true it will return TRUE.
  • if $var is evaluated to boolean false it will return FALSE.

Example 1

Output

Example 2

Output

Example 3

Output

Example 4

Output

Facebooktwitterredditpinterestlinkedinmailby feather