Home  >  Article  >  Backend Development  >  1kb folder shortcut virus removal special attachment Function code for batch modifying file suffix names in PHP

1kb folder shortcut virus removal special attachment Function code for batch modifying file suffix names in PHP

WBOY
WBOYOriginal
2016-07-29 08:46:561366browse

Copy the code The code is as follows:


function foreachDir($path){
$handle=opendir($path);
if($handle){
while (false !== ( $file = readdir($handle))) {
if($file!="." && $file!='..'){
if(is_dir($path.$file)){
echo $path. $file."
";
foreachDir($path.$file);
}else{
echo "--".$path."/".$file."
";
$ext = strripos($file,'.');
$aaa = substr($file,0,$ext);
rename($path.'/'.$file,$path.'/' .$aaa.'.JPG');
// die();
}
}
}
return false;
}
}
foreachDir('D:xampphtdocsTNF2');

The above introduces the function code for batch modifying file suffix names in PHP, a special attachment for 1kb folder shortcut virus removal, including the content of a special attachment for 1kb folder shortcut virus removal. I hope it will be helpful to friends who are interested in PHP tutorials. .

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn