How can I manually interpolate a string?
There are more mechanisms than PHP string literal syntax to replace placeholders in strings! A pretty common one is sprintf
:
$str = 'This is a %s';
$a = 'test';
echo sprintf($str, $a);
http://php.net/sprintf
There are a ton of other more or less specialised templating languages. Pick the one you like best.