This is my array
Array
(
[33] => Array
(
[for sale] => Array
(
[1] => villas
[2] => plots
[3] => flats
[4] => houses
)
)
[34] => Array
(
[for rent] => Array
(
[5] => in house
[6] => appartment
[7] => godams
)
)
[35] => Array
(
[hostels] => Array
(
[8] => boys
[9] => girls
)
)
[36] => Array
(
[pg accommodation] => Array
(
[10] => boys
[11] => girls
)
)
)
and my php code is this..
while($row = mysql_fetch_array($select4)){
$final[$row['child_category_id']][$row['child_category_name']][$row['sub_child1_category_id']] = $row['sub_child1_category_name'];
}
echo '<pre>';print_r($final);echo'</pre>';
foreach($final as $k1 => $arr1)
{
foreach($arr1 as $k2 => $arr2){
echo '<b>'.$k2.'</b><br>';
foreach($arr2 as $subcat){
echo $subcat.'<br/>';
}
}
}
It displays the records like this
for sale
villas
plots
flats
houses
for rent
in house
appartment
godams
hostels
boys
girls
pg accommodation
boys
girls
How to align them inline..
i need to display 2 records in a row
eg:
For sale and For rent with sub categories in 1 row
Then
hostels and pg accomodation in another row