开发者

Problem with preg_replace /e modifier when used in a loop

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜