이름에 .jpg를 추가하여 파일의 이름을 바꾸는 방법은 무엇입니까? 파일에는 스크린 샷과 같이 확장자가 없습니다. 하지만 각 .jpg 추가하고 싶습니다 - 일괄 이름 바꾸기 일종의 일을 PHP 함수가 있나요? ,PHP에서 파일 이름 바꾸기
$dir = opendir('directory containing files');
// loop through all the files in the directory
while (false !== ($file = readdir($dir)))
{
rename($file, $file.".jpg");
}
// close the directory handle
closedir($dir);
이 왜 PHP를 사용할까요? – Joe
거기 있고, 그것은 ['rename'] (http://www.php.net/manual/en/function.rename.php)라고 불립니다. 누가 알았 겠어? – Jon
가능한 복제본 http://stackoverflow.com/search?q=Rename+files+in+PHP – Gordon