PHP 5.5 Replace deprecated preg_replace /e with preg_replace

CodeCharge Studio 2.x, 3.x, 4.x, 5.x
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

PHP 5.5 Replace deprecated preg_replace /e with preg_replace

文章 yehlu »

代碼: 選擇全部

    //$file_content = preg_replace("/\\{res:\s*CCS_FormatInfo\\}/ise", "CCConvertEncoding(\$CCSLocales->GetText('CCS_FormatInfo'), \$FileEncoding, \$this->internal_encoding)", $file_content);
    $file_content = preg_replace_callback("/\\{res:\s*CCS_FormatInfo\\}/is",function($m){ return "CCConvertEncoding(\$CCSLocales->GetText('CCS_FormatInfo'), \$FileEncoding, \$this->internal_encoding)";}, $file_content);

    //$file_content = preg_replace("/\\{res:\s*(\w+)\\}/is", "\$CCSLocales->GetText('\\1')", $file_content);
    $file_content = preg_replace_callback("/\\{res:\s*(\w+)\\}/is",function($m){ global $CCSLocales; return $CCSLocales->GetText($m[1]);}, $file_content);

回覆文章

回到「CodeCharge Studio」