how to space in php code code example
Example 1: php replace space with underscore
$str = str_replace(' ', '_', $str);
Example 2: php string replace space
$journalName = preg_replace('/\s+/', '_', $journalName);
$str = str_replace(' ', '_', $str);
$journalName = preg_replace('/\s+/', '_', $journalName);