this is my code, it displays all the categories like
A
-A.1
-A.2
B
-B.1
-B.2And now i want it displays only
A.1
A.2
B.1
B.2
Any idea?
function current_categories($m,$id){
$cat_array=array();
$sql = "select * from `category`";
$query = DB::Query($sql);
while($row = DB::fetch_array($query)){
$cat_array[] = array($row['id'],$row['name'],$row['classid'],$row['sort']);
}
if($id==""){
$id=0;
}
$n = str_pad('',$m,'-',STR_PAD_LEFT);
$n = str_replace("-"," ",$n);
for($i=0;$i<count($cat_array);$i++){
if($cat_array[$i][2]==$id){
echo "<li>"."<a href=\"/team/index.php?gid=".$cat_array[$i][0]."\">".$cat_array[$i][1]."</a></li>";
current_categories($m+2,$cat_array[$i][0]);
}
}
}