You want str_replace:
str_replace
$e_type = str_replace(' ', '_', $e_type);
Check this. You have some nice examples there...