<?
//define the path as relative
$path = "C:/apache/htdocs/roms";

//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");

echo "Directory Listing of $path<br/>";

//running the while loop
while ($file = readdir($dir_handle)) 
{
   $newfile = str_replace("-"," ",$file);
   rename($file,$newfile);
   echo $newfile."<br />";
}

//closing the directory
closedir($dir_handle);

?> 