[php][/php]<?php
$dirname=$_POST[‘dir’];
$topath=$_POST[‘path’];
echo $dirname;
$yourStartingPath = 'mp3';
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($yourStartingPath),
RecursiveIteratorIterator::SELF_FIRST);
foreach($iterator as $file) {
if($file->isDir()) {
$path = $file->getRealpath();
$path2 = PHP_EOL;
$path3 = $path.$path2;
$res=explode('/', $path3);
$result = end($res);
$dir= basename($result );
echo “”;
echo “”;
echo “”;
echo “”;}}
$dir1=“mp3”.$dirname;
echo $dirname;
//Open images directory
$dir = opendir("$dir1");
//List files in images directory
while ($dir&&($file = readdir($dir)) !== false)
{
if($dir&&!is_dir($file)){
echo "filename: " . $file . “
”;
}}
closedir($dir);
<? [php][/php]