I've tried and tried and tried.... ;-)

I have this array;

$bikes = array(
     "Road"  => array(
          "Trek"  => array(
                    "Trek 5200" => "road.php?brand=t5200"
                    ),
          "Schwinn" => array(
                    "Schwinn Fastback Pro"  => "road.php?brand=schfp"
                    ),
          "Moots" => array(
                    "VaMoots"  => "road.php?brand=vamoots"
                    ),
          "Lemond" => array(
                    "Zurich" => "road.php?brand=zurich",
                    "Chambery" => "road.php?brand=chambery",
                    "BuenosAries" => "road.php?brand=bueno",
                    "Tourmalet" => "road.php?brand=tourmalet"
                    )
     )
);

I'm trying to list the four brands followed
by each brands model and URL. I.E.
Trek
Schwinn
Moots
Lemond

Trek 5200
Schwinn Fastback Pro

etc....

What am I doing wrong here,

        if ($cat == 'bikes') {
          while ( list($type,) = each($bikes["Road"])) {
           echo "<TD><A HREF=\"$type\" CLASS=\"menu\">$type</A></TD>\n";
          }
          while ( list($typ,) = each($bikes["Road"])) {
            while (list($val, $key)=each($bikes["Road"][$typ])) {
                echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\"
HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>\n";
                echo "<TD><A HREF=\"$key\" CLASS=\"menu\">$val</A></TD>\n";
            }
         }
        }

The first while loop works but not the second pair.
I thought $typ would contain the brand on each pass
but this returns nothing.......

Help... :(

-Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to