Home > Article > Backend Development > Function code for batch modifying file suffix names in PHP
The code is as follows:
"; 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:\xampp\htdocs\TNF2');