Php: Converting String to Boolean
Lear, how to convert a string to boolean value in PHP.
To convert a string to boolean, we can use the triple equals operator ===
in Php.
Here an example:
$name = 'king';
$check = ($name === 'true');
Lear, how to convert a string to boolean value in PHP.
To convert a string to boolean, we can use the triple equals operator ===
in Php.
Here an example:
$name = 'king';
$check = ($name === 'true');