Jump to content

fallenboy

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fallenboy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The function works fine, but it outputs HTML. I want it to output multilevel array: now. <ul> <li>menu 1 <ul> <li>menu 1 1</li> <li>menu 1 2</li> </ul> </li> <ul> but i want it to output multievel PHP array. array ->menu[1] -> array(id => 2, parent =>1), array(id =>3, parent => 1) I just cant make it work
  2. Hi guys. I have a problem and i cant solve it b myself. Im pretty sure it has an easy solution but I just can't figure it out... This code outputs nested unordered list, but I need it to output array, multi level: function do_menu($parent, $menu) { $result = do_mysql("SELECT id, title FROM pages WHERE parent='{$parent}' ORDER BY id"); if(mysql_affected_rows() != 0) { $menu .= "<ul>\n"; while ($row = mysql_fetch_array($result)) { $menu .= "<li><a href=\"".ADMINURL."menu/index.php?section=open&id=".$row['id']."\">".stripslashes(htmlspecialchars_decode($row['title']))."</a>"; $menu = do_menu($row['id'], $menu); $menu .= "</li>\n"; } $menu .= "</ul>\n"; } else $menu = false; return $menu; } Can somebody help me, please? Thanks guys PS! If this function sucks, it's OK as I'm not very good programmer, more HTML-guy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.