How can I convert string to boolean?

$string = 'false';

$test_mode_mail = settype($string, 'boolean');

var_dump($test_mode_mail);

if($test_mode_mail) echo 'test mode is on.';

it returns,

boolean true

but it should be boolean false.

20 Answers
20

Leave a Reply

Your email address will not be published. Required fields are marked *