I have this language system:
$lang = include('lang/en.php'); // default language
$lg = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // detect language
if ($lg == "de") $lang = array_merge($lang, include('lang/de.php')); // load german file and merge
function __($name,$values)
{
global $lang;
return $lang[$name];
}
lang/en.php
looks like this for example:
<?php
return array(
'GREET' => 'Hello '.$values[0].', welcome '.$values[1].'!',
?>
Now I'm trying to output this using variables like this in an array:
$values = array("Max","Home");
echo __('GREET',$values);
This will only output Hello , welcome !
instead of Hello Max, welcome home!
How could I manage to also output the variables?