Voting

: six plus two?
(Example: nine)

The Note You're Voting On

nicolas dot grekas+php at gmail dot com
15 years ago
Here is how to accurately test for boolean php.ini values:

<?php

function ini_get_bool($a)
{
$b = ini_get($a);

switch (
strtolower($b))
{
case
'on':
case
'yes':
case
'true':
return
'assert.active' !== $a;

case
'stdout':
case
'stderr':
return
'display_errors' === $a;

default:
return (bool) (int)
$b;
}
}

?>

<< Back to user notes page

To Top