replace spaces with _ in php replace spaces with _ in php php php

replace spaces with _ in php


You want str_replace:

$e_type = str_replace(' ', '_', $e_type);


Check this. You have some nice examples there...