View Single Post
ישן 30-08-11, 19:30   # 5
link
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 36
הודעות: 191

link לא מחובר  

והאלגוריתם הסופי(למי שירצה אי פעם להשתמש בזה):
PHP קוד:
    function language_login() {
        if(!empty(
$this->output)) {
            
preg_match_all("/{%lang\['([^'\]]+)'\]\['([^'\]]+)'\]}/ismx"$this->output$arr);
            
            
// unified keys.
            
foreach($arr[1] as $value) {
                
$unified[$value] = true;
            }
            
            foreach(
array_keys($unified) as $key) {
                foreach(
$arr[2] as $value) {
                    if(isset(
$this->lang[$key][$value])) {
                        
$this->output str_replace("{%lang['{$key}']['{$value}']}"$this->lang[$key][$value], $this->output);
                    }
                }
            }
        }
    } 
תודה רבה על העזרה.
  Reply With Quote