How to parse a string trueand falsean array so that they became the logical, if they exist?
For instance,
form
$config = array(
"allow_n" => "true",
"allow_m" => "false",
"say" => "hello"
);
to
$config = array(
"allow_n" => true,
"allow_m" => false,
"say" => "hello"
);
Is it possible?
EDIT:
Thanks guys for the help.
Sorry, I forgot to clarify from the very beginning - this case can happen in a multi-level array, for example,
$config = array(
"allow_n" => "true",
"allow_m" => "false",
"say" => "Hello",
"php" => array(
"oop" => "true",
"classic" => "false"
)
);
source
share