View Single Post
Old 09-01-2015, 06:24 PM  
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
PHP preg_replace_callback help needed

trying to avoid going on stackoverflow don't want to deal with the Q&A ego police that mod that site. Any i'm getting this error Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in any assistance greatly appreciated

Code:
//load current language
        foreach ($langs as $key => $value) if ($value['l_code'] == lang) break;
        $f = fopen('languages/'.$langs[$key]['l_file'],'r') or die('Cannot open language file '.$langs[$key]['l_file']);
        while (!feof($f)) {
                $s = chop(fgets($f,4096));
                if ($s{0} == '#') continue;
                list($key,$value) = explode('=',$s,2);
                $value = preg_replace('/<%(.*)%>/sUe', '@constant("\\1")', $value);
                $def[$key] = $value;
                }
        fclose($f);
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote