array with all special character
protected $name_skip_chars = array( "~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(",")","-","+","=", "{","}",
"[","]","|","\\",":",";","\"","'","<",",",">",".","?","/"," "
);

use to replace characters :

$file_name= str_replace($this->name_skip_chars, "_",$file_name);

Advertisements