hey guys im looking for a way to show all mp3 files in a directory
this is my code to get that :
    if ($handle = opendir($dirPath)) {
       while (false !== ($file = readdir($handle))) {
         if ($file = ".mp3" && $file = "..") {
             echo '
             <track>
              <location>'.$dirPath.$file.'</location>
              <creator>'.$file.'</creator>
            </track>
            ';    
          }
       }
   closedir($handle);
}
now i know that this script will only show mp3 files in parent directory , but i need to show all mp3 files in all directory inside parent directory
problem is this code cant show files inside sub directories !