There is a pattern. It has entries of the type {_LANG_}{ru}сутки{en}day{_LANG_}
. There is a $slln
variable that contains the selected language. My asked to replace the entire record with the text of the selected language. For example, if $slln='en'
, then the entire entry should be replaced with day
. I understand that one team does not do this, so I do this:
preg_match_all("/{_LANG_}(.*){_LANG_}/",$overall_output,$mt);
Here the result is as follows:
$mt = Array ( [0] => Array ( [0] => {_LANG_}{ru}сутки{en}day{_LANG_} [1] => {_LANG_}{ru}неделю{en}week{_LANG_} [2] => {_LANG_}{ru}месяц{en}month{_LANG_} [3] => {_LANG_}{ru}все время{en}all time{_LANG_} ) [1] => Array ( [0] => {ru}сутки{en}day [1] => {ru}неделю{en}week [2] => {ru}месяц{en}month [3] => {ru}все время{en}all time ) )
The question is how to remove all values from $mt[1]
order to get something like:
Array ( [0] => Array ( [ru] => сутки [en] => day ) [1] => Array ( [ru] => неделю [en] => week ) ... )