You can use str_replace :
<?
$replace_what = array(" ", "(", ")");
$replace_by = "_"; // you can change it, and even use an array, just like $replace_what
$filename = str_replace($replace_what, $replace_by, $filename);
?>
Also, you could use a regular expression so change everything that is not a letter or a number in something else... but I'm not good with regular expressions... !