<?php
buildtree($skpd);
function buildtree($src_arr, $parent_id = 0)
{
?>
<ul>
<?php
foreach($src_arr as $idx => $row)
{
if($row['skpd_parent_id'] == $parent_id)
{
?>
<ul>
<li><?php echo $row['skpd_id'];?></li>
</ul>
<?php
unset($src_arr[$idx]);
buildtree($src_arr, $row['skpd_id']);
}
}
?>
</ul>
<?php
}
?>
Kamis, 09 Oktober 2014
Looping Recursive PHP
Langganan:
Postingan (Atom)