It already is in boolean form. Try to use var_dump($array[0]['visibility']); and it'll output bool(true) or bool(false).
print_r automatically converts the boolean to 1 for true and (empty) for false when outputting, but it doesn't change the data type.
You can use var_dump on your array to get a better output:
<?php
$array = array(
'booleanTrue' => true,
'booleanFalse' => false,
'integer' => 1
);
var_dump($array);
print_r($array);
/*
array(3) {
["booleanTrue"]=>
bool(true)
["booleanFalse"]=>
bool(false)
["integer"]=>
int(1)
}
Array
(
[booleanTrue] => 1
[booleanFalse] =>
[integer] => 1
)
*/
?>
DEMO
Edit:
Here's a function to give you a nicer/more compact var_dump output very similar to print_r:
<?php
function var_dump_r($variable, $return = false) {
ob_start();
var_dump($variable);
$output = preg_replace('/\["([^"]+)"\]/', '[$1]', preg_replace('/\s*=>\s*/', ' => ', ob_get_clean()));
if (!$return) {
echo $output;
}
return $return;
}
var_dump_r(array(
'booleanTrue' => true,
'booleanFalse' => false,
'integer' => 1
));
/*
array(3) {
[booleanTrue] => bool(true)
[booleanFalse] => bool(false)
[integer] => int(1)
}
*/
?>