Example #1
0
 function treeview1($array1, $id1 = 0)
 {
     for ($i1 = 0; $i1 < count($array1); $i1++) {
         if ($array1[$i1][parent_id] == $id1) {
             global $parent;
             if ($parent == $array1[$i1][id]) {
                 $selected = "selected";
             } else {
                 $selected = "";
             }
             echo "<option  value='" . $array1[$i1][id] . "' {$selected} >" . str_repeat("-", $array1[$i1][label] * 2) . $array1[$i1][title] . '</option>';
             treeview1($array1, $array1[$i1]['id']);
         }
     }
 }
function treeview1($array1, $id1 = 0)
{
    for ($i1 = 0; $i1 < count($array1); $i1++) {
        if ($array1[$i1][parent_id] == $id1) {
            echo "<option  value='" . $array1[$i1][id] . "' >" . str_repeat("-", $array1[$i1][label] * 2) . $array1[$i1][title] . '</option>';
            treeview1($array1, $array1[$i1]['id']);
        }
    }
}