I am new to php scripting and been following a tutorial video. I'm getting an error on trying to output an array from php via command line, this is the code named as array1.php:
<?
# Canada, USA, Mexico
$arr1 = array("Toronto", "Ottawa", "Montreal", "Quebec");
$arr2 = array("Boston", "New York", "Santa Barbara", "San Francisco");
$arr3 = array("Mexico City", "Cozumel", "Cancun", "Aculpoco");
# array 4 is an associative array
$arr4 = array("Canada" => $arr1, "USA" => $arr2, "Mexico" => $arr3);
print_r($arr4);
?>
The tutorial video says I'll just need to follow the instructions/code and perform "php array1.php" but getting this:
$ php array1.php
<?
# Canada, USA, Mexico
$arr1 = array("Toronto", "Ottawa", "Montreal", "Quebec");
$arr2 = array("Boston", "New York", "Santa Barbara", "San Francisco");
$arr3 = array("Mexico City", "Cozumel", "Cancun", "Aculpoco");
# array 4 is an associative array
$arr4 = array("Canada" => $arr1, "USA" => $arr2, "Mexico" => $arr3);
print_r($arr4);
?>