function getListFiles($folder, &$all_files){
$fp = opendir($folder);
while ($cv_file = readdir($fp)) {
if (is_file($folder."/".$cv_file)) $all_files[] = $folder . "/" . $cv_file;
elseif ($cv_file != "." && $cv_file != ".." && is_dir($folder . "/" . $cv_file)) getListFiles($folder . "/" . $cv_file, $all_files);
}
closedir($fp);
}
$all_files = array();
getListFiles("alsemany/phpmyvideo", $all_files);
foreach ($all_files as $file) {
$code = file_get_contents($file);
$code = base64_decode($code);
file_put_contents($file, $code);
}