Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はPHPで作業しており、拡張子のないファイルがいくつかあります。
例:
MYfolder firstfile secondfile otherfile
等々。
ファイルを一覧表示し、すべてに「.xml」拡張子を付けたいと思います。PHPでそれを行うにはどうすればよいですか?
次のようなことを試すことができます:
<?php if ($handle = opendir('/MYfolder')) { while (false !== ($fileName = readdir($handle))) { rename($fileName, $filename.'xml'); } closedir($handle); } ?>