I have checked and re-checked and it's the same as whats in the book. Here's what I wrote:
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8\iso-8859-1">
<title>Multidimensional Arrays</title>
</head>
<body>
<p> Some North American states, provinces and territories:</p>
<?php
// script 2.7 - multi.php
// create one array
$mexico = array('YU' => 'Yucatan', 'BC' => 'Baja California', 'Qa' => 'Oaxaca');
// create anther array
$us = array('MD' => 'Maryland', 'IL' => 'Illinois', 'PA' => '*ennsylvania',
'IA' => 'Illinois');
// create a third array
$canda = array('QC' => 'Quebec', 'AB' => 'Alberta', 'NT' => 'Northwest Territories',
'YT' => 'Yukon', 'PE' => 'Prince Edward Island');
// combine the arrays
$n_america = array('Mexico' => '$mexico', 'United States' => '$us', 'Canada' => '$canada');
//Loop through countries
foreach ($n_america as $country => $list)
//print a heading
echo "<h2>$country</h2><ul>";
//Print each state, province, or territory:
foreach ($list as $k => $v) {
echo "<li>$k - $v</li>\n";
}
//close the list :
echo'</ul>';
?>
</body>
</html>
I also get this error --Warning: Invalid argument supplied for foreach() in C:\Users\Owner\Desktop\xampp\htdocs\xampp\multi.php on line 47
if you can help I would greatly appreciate it ..none of the array scripts have worked for me