View Single Post
ישן 18-12-13, 02:47   # 4
MAORBARI
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Sep 2008
הודעות: 484

MAORBARI לא מחובר  

טעיתי.. תיקון קוד:
PHP קוד:
preg_replace('/\{(.*?)\}/ei''print str_replace(\'{$1}\', $temp[\'$1\'], $text);'$text); 
יש גם את האפשרות הזו:
PHP קוד:
echo preg_replace_callback('/\{(.*?)\}/i', function($varMatches) {
    return 
$GLOBALS['temp'][$varMatches[1]];
}, 
$text); 

Last edited by MAORBARI; 18-12-13 at 03:04..
  Reply With Quote