Provide an instance of the PHP custom function, this is a batch to modify the file suffix name of the PHP program, the need for friends can refer to.
The code is as follows |
Copy Code |
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 '); |
http://www.bkjia.com/PHPjc/631686.html www.bkjia.com true http://www.bkjia.com/PHPjc/631686.html techarticle provide an instance of the PHP custom function, this is a batch to modify the file suffix name of the PHP program, the need for friends can refer to. Code to copy code like this? PHP function ...