Question: I am trying to dynamically load a php form from a selected menu option, drawing the relevant form name from a mysql database and then loading the file. If relevant the actual php form is held outside the database in a directory.

I have the following line of code which I've been playing around with but to no avail

```
<a href="$submenu["form_name"]">$submenu["menu_name"]</a>

```

where $submenu is an associative array with an element called 'form\_name'. This is the database field which contains the php form I'm trying to load into the 'a href'. It also contains the element called 'menu\_name' which is just text. 
The array works as I've tested it by loading a generic script and drawing the row id from the database but written this way its complaining that the $submenu variable is unexpected.

Answer: 
See [here](http://en.wikipedia.org/wiki/Taxicab_geometry) . 

In essence, the taxicab distance between (x1,y1) and (x2,y2) is `|x1-x2| + |y1-y2|` (|z| means abs(z))
My approach would have been to use a two-dimensional array - it just seems the simplest and most natural representation of the problem.

I would set all values of the array to 0, randomize and reset certain indices to -1 (mines), and increment the count of each adjacent square of these indices by 1.