When I use following code:
$text = /*some text*/;
$langs = array('en', 'pl');
foreach($langs as $lang) {
$text = preg_replace("/I18N\('(.+?)'\)/e", 'func("$1", "$lang")', $text);
}
preg_replace only works for the first array element ('en' in this example). What am I doing wro开发者_开发知识库ng?
I [won't] will answer though regular expressions are opaque to me: it looks like you are replacing the text in the first pass, and the second pass, there's no match
精彩评论