I have this text-array
$text = array( "T02" => array( 'EN' => 'English text for T02'),
"T03" => array( 'FR' => 'Texte anglais pour T03'));
$language = "FR";
$testtext = "Translated text: {#text['T03'][$language]}";
I need the # here because I get this text from a database through a function.
So I need to replace de # with a $
// This will work, but I need 'T03' and $language to be variable:
$output = str_replace("{#text['T03'][$language]}","{$text['T03'][$language]}",$testtext);
echo $output;
// This won't work:
$output = str_replace("#text","$text",$testtext);
echo $output; // I get ==> Translated text: {Array['T03'][FR]}
How can I replace "{#text['..var1..'][..var2..]}" ==> {$text['..var1..'][..var2..]} ?