Addressed to: <[EMAIL PROTECTED]>
[EMAIL PROTECTED]
** Reply to note from <[EMAIL PROTECTED]> Fri, 23 Feb 2001 12:20:12 -0500
>
> 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"
> )
> ),
> "Dirt" => array(
> )
> );
I would probably do something like:
# reset( $Bikes )
while( list( $BikeType, $Manufacturers ) = each( $bikes )) {
echo "$BikeType<BR>\n";
# reset( $Manufacturers );
while( list( $Mfr, $Models ) = each( $Manufacturers )) {
echo " $Mfr<BR>\n";
# reset( $Models );
while( list( $Model, $URL ) = each( $Models )) {
echo " " .
"<A href=\"$URL\">$Model</A><BR>\n"; }
}
}
This would give
Road
Trek
Trek <-- is a link
Schwinn
Schwinn Fastback Pro <-- is a link
Moots
VaMoots <-- is a link
Lemond
Zurich <-- is a link
Chambery <-- is a link
BuenosAries <-- is a link
Tourmalet <-- is a link
Dirt
If you realy want
Trek
Schwinn
Moots
Lemond
Trek <-- is a link
Schwinn Fastback Pro <-- is a link
VaMoots <-- is a link
Zurich <-- is a link
Chambery <-- is a link
BuenosAries <-- is a link
Tourmalet <-- is a link
You need to do the outer look twice, doing a reset() in it between them,
and doing the reset()s I have commented out in the example. Be aware if
you go thru the array more than once in the program it will be needed.
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com
--
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]