$result in arrays don't print result code example
Example 1: php echo an array to console
echo "<script>console.log('" . json_encode($data) . "');</script>";
Example 2: dsiplay array on php
$array = array(
1 => 'apple',
2 => 'banana',
)
// Method 1
echo "<pre>";
print_r($array);
echo "</pre>";
// Method 2
echo "<pre>";
var_dump($array);
echo "</pre>";
// Method 3 (cakephp)
pr ($array);