Re: logic with arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wee Keat wrote:

Hey Jeff,

How are you mate? Was lazying around and saw your email to the list. :)

What exactly do you need help with? Is it the following line?

// Stuck here
$html_menu .= "<li><a href=\"Need to get value\">$sub_page</a></li>";
}
$html_menu .= '</ul>';


Do you need to get the value of the link and the name of the link? If so, try this:

===== begin snippet =======

$html_menu .= '<ul id="subnav">';
     foreach ($menu_page[$menu_name[1]] as $sub_page => $sub_link)
       {
         // Stuck here
         $html_menu .= "<li><a href=\"$sub_link\">$sub_page</a></li>";
       }
       $html_menu .= '</ul>';
     }


===== end snippet =========


What about using recursive functions? I think it's easier as you can create unlimited numbers of sub-menus. It's slow though.




Ah Thanks Keat long time no hear/see ...... it works now. :-)

How are you keeping anyway ? You totally ignore us now at phpMelb :-(

Come along to our next meeting on 13th Jan 2005

cheers,
Jeffery

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux