Php batch modifies the code of the file extension. Provides a php user-defined function for an instance. this is a php program that can modify file extensions in batches. For more information, see. The code is as follows: Copy the code? Phpfunction provides a php user-defined function for an instance. this is a php program that allows you to modify file extensions in batches. For more information, see.
| 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 '); |
Bytes. The code is as follows? Php function...