The most recent changes to the ASP suffix to PHP, because lazy in a change. Also think that PHP is the same as QT is a high-level language, the general high-level language has provided the content to be added to the search function. As a then, on the Internet search, and really a lot, so some will be the intention to sum up.
Objective: To change the ASP suffix in the current directory to PHP without affecting other "suffix format files," and only for "current folder", the files contained in the current folder are not modified.
The code is as follows:
!--? php function Foreachdir ($dirname) {if (!is_dir ($dirname)) {echo {$dirname} not
Effective dir;
Exit (); $handle =opendir ($dirname); Opens the directory while ($file = Readdir ($handle))!==false)//reads the directory {if ($file!=. && $file!=& #39;
& #39;) {if (Is_dir ($dirname. $file)) {echo $dirname. $file.
; Foreachdir ($dirname. $file);
If the annotation number is removed, the folder file in the folder will be recursively modified} else {echo--. $dirname./. $file.; $temp = substr ($file, Strrpos ($file, & #39;. & #39;) + 1); Get suffix format if ($temp = = ASP) {$pos = Strripos ($file, & #39;. & #39;); Gets the location of the filename $filename = substr ($file, 0, $pos); Gets the filename rename ($dirname. & #39;/& #39; $file, $dirname. & #39;/& #39; $filename #39; php& #39;
Replace with the PHP suffix format. }}} foreachdir (& #39; /traversemendfilename& #39;);
-->