Originally posted by LordShryku
Break out of the string like you do with $prefix for your other variables too. You can leave variables in the string if they're not superglobals(like $SESSION). A good practive would be to break out of the string for all_ variables.
Just wanted to clear a possible misconception, the above isn't true. You cannot use arrays within strings without paying close attention to how you use said array but whether it's a superglobal or not does not matter. A string is a string, an array is an array. The manual page weedpacket quoted has a ton of examples but essentially it all comes down to creating a proper string in PHP, and properly using 'quotes'.
// VERY BAD
$strA = "Hello there $friends['doh'] this is a parse error";
$strB = "Hello there " . $friends[doh] . " this is a E_NOTICE error";
// GOOD
$strC = "Hello there {$friends['woohoo']} this is fine";
$strD = "Hello there $friends[woohoo] this is fine";
$strE = "Hello there " . $friends['woohoo'] . " this is fine";
So, using 'quotes' around array keys inside of strings requires special attention, and when using an array outside of a string ($strB and $strE) one should quote the array key otherwise an error of level E_NOTICE will result. So in your code you will either use {} OR con . cat . en . ation to construct the string. Read the manual for more details.