implode the array to string with space in between php code example
Example 1: php string replace space
$journalName = preg_replace('/\s+/', '_', $journalName);
Example 2: php insert hyphen into spaces in string
$test = "jjfnj 948";
$test = str_replace(" ", "", $test); // strip all spaces from string
echo substr($test, 0, 3)."-".substr($test, 3); // isolate first three chars, add hyphen, and concat all characters after the first three
Example 3: php glue strings
<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
$a = "Hello ";
$a .= "World!"; // now $a contains "Hello World!"
?>