Rumah > Soal Jawab > teks badan
<select class="span6 disabled" style="padding-left: 0px;" id="val-select2" name="path" style="width: 100%;" data-placeholder="Select page" tabindex ="-1" aria-hidden="true" aria-describedby="val-select2-error" aria-invalid="false">
<option value="<?php echo $setting['path ']; ?>"><?php echo $setting['path']; ?>(Jangan pilih ini)</option>
<?php
function traverseDir($dir ) {
if($dir_handle = @opendir($dir)){
while($filename = readdir($dir_handle)){
if($filename != "." && $filename != ".. " ){
$subFile = $dir.DIRECTORY_SEPARATOR.$filename; //Untuk menyambungkan direktori sumber dan subfail
if(is_dir($subFile)){ //Jika subfail ialah direktori
echo '< option value="theme/'.$filename.'">'.$filename.'</option>';
traverseDir($subFile); //Cari semula nama direktori bawahan
}
}
}
closedir($dir_handle);
}
}
echo traverseDir(ROOT.'../theme/');
?>
?>?>