<?php
// Get an array of all files in the directory using glob()
$files = glob('./*.jpg');
// Loop through the array of files
foreach($files as $file) {
// Output each file name on a new line
echo "mv " . $file . " " . str_replace(" ","_", $file) . "\n";
}
?>