Function to get the recursive folder structure of the destionation folder
/** * getDirStructure * get the recursive folder structure of the destionation folder * @param string $path folder path * @param array array resultant folders and files * @access public */ public function getDirStructure($path, &$a, $sOriginalZipFilepath){ $aDir=array(); $aFiles=array(); $nd=0; $nf=0; $hndl=opendir($path); while($file=readdir($hndl)){ if ($file ==’.’ || $file==’..’) continue; if (is_dir($path.’/’.$file)){ $aDir[$nd++]=$file; } else{ $aFiles[$nf++]=$file; } } closedir($hndl); $n=1; for ($i=0;$i<count($aDir);$i++){ $this->getDirStructure($path.’/’.$aDir[$i].’/', $a[$n]); $a[$n++][0]=str_replace("//","/",$path.$aDir[$i]); } for ($i=0;$i<count($aFiles);$i++){ $a[$n++]=str_replace("//","/",$path.$aFiles[$i]); } }