php change space with underscore code example
Example 1: php replace space with underscore
$str = str_replace(' ', '_', $str);
Example 2: php convert spaces to underscores
$str = str_replace(' ', '_', $str);
$str = str_replace(' ', '_', $str);
$str = str_replace(' ', '_', $str);