I have a function language($tag)
that requires a file lang.php
which contains an array called $lang
which contains some parameters. In particular a string $lang['message']
. After some execution lines it returns $lang['message']
.
The $lang array is defined as follows:
$lang[$tag] = array(
'message' => 'This is a message',
...
);
Now let's say I'd like to be able to set parameters inside $lang['message']
that I should be able to define on language($tag, $parameters)
. And these parameters should set a var inside $lang['message']
such as:
$lang[$tag] = array(
'message' => 'This is a '. $1,
...
);
How is the best way of organize language($tag, $parameters)
so that what is in $parameters
sets $1
in $lang['message']
?
If you didn't understand I'd like to be able to call language($tag, 'post')
and make it return 'This is a post'
.