In PHP, strings are concatenated together as follows:
$foo = \"Hello\"; $foo .= \" World\";
Here, $foo becomes \"Hello World\"
$foo
In my opinion, the simplest way to concatenate two strings is to write a function that does it for you, then use that function.
function concat () { prefix=$1 suffix=$2 echo "${prefix}${suffix}" } foo="Super" bar="man" concat $foo $bar # Superman alien=$(concat $foo $bar) echo $alien # Superman