Well, it's saying that because $key is an array;) For example,
"Mountain" is a $sub_cat:
> "Mountain" => array(
> "Trek" => array(
> "Fuel 100" => "mountain.php?brand=tfuel90",
> "Fuel 90" => "mountain.php?brand=schhg"
> ),
> "Klein" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> ),
> "Gary Fisher" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> ),
> "Moots" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> )
> ),
As you loop through, value will cycle "Trek","Klein","Gary
Fisher","Moots" ... $key will be the *array* that is referenced by each
of those $values --- while I understand what you're doing here, you are
really playing ass-backward with naming convention there:) ... normally
you deal in $key/$value pairs --
Bottom line is that you need to either cycle through $key array and
display multiple links, or you need to supply a subscript/key into the
array in your existing code.
Hank
On Fri, Nov 30, 2001 at 04:58:58PM -0500, Brian V Bonini wrote:
> I'm stuck. $key returns "Array" how can I get at each
> level of this array?
>
> if ($cat == 'bikes' && $sub_cat != 'Road') {
> while (list($val, $key)=each($bikes[$sub_cat])) {
> 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";
>
> $bikes = array(
> "Road" => array(
> "Trek" => array(
> "Trek 5200" => "road.php?brand=t5200"
> ),
> "LeMond" => array(
> "Zurich" => "road.php?brand=zurich",
> "Chambery" => "road.php?brand=chambery",
> "Alpe d'Huez" => "road.php?brand=alpe",
> "BuenosAries" => "road.php?brand=bueno",
> "Tourmalet" => "road.php?brand=tourmalet"
> ),
> "Moots" => array(
> "VaMoots" => "road.php?brand=vamoots"
> )
> ),
> "Mountain" => array(
> "Trek" => array(
> "Fuel 100" => "mountain.php?brand=tfuel90",
> "Fuel 90" => "mountain.php?brand=schhg"
> ),
> "Klein" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> ),
> "Gary Fisher" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> ),
> "Moots" => array(
> "bike 1" => "URL",
> "bike 2" => "URL"
> )
> ),
>
>
> --
> 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]
>
--
Hank Marquardt <[EMAIL PROTECTED]>
http://web.yerpso.net
GPG Id: 2BB5E60C
Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
*** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD
*** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild
*** Beginning PHP -- Starts January 7, 2002
*** See http://www.hwg.org/services/classes
--
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]