Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-29 08:46:56
Original
1489 people have browsed it

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. .

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template