replace _ with space php code example
Example 1: php replace space with underscore
$str = str_replace(' ', '_', $str);
Example 2: php replace space with 20
//Replace space with %20 for url to understand
$new = str_replace(' ', '%20', $your_string);
//Alternate for URL use, use this
urlencode ( string $str )
Example 3: php string replace space
$journalName = preg_replace('/\s+/', '_', $journalName);