ציטוט:
נכתב במקור על ידי miniature
אתה מחפש את ה REGEX?
עריכה:
אם אתה צריך ניסיתי משהו:
PHP קוד:
preg_match(/[phpcode]([sS]+)[/phpcode]/gi,highlight_string($1));
|
מממ זה לא עובד
הכנתי משהו:
PHP קוד:
$match = '#\[PHP\](.*?)\[\/PHP\]#se';
$before = "<div style=\"margin:25px; margin-top:5px\"><div class=\"smallfont\" style=\"margin-bottom:2px\">PHP ÷åã:</div><div class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; overflow:auto\"><code style=\"white-space:nowrap\"><div dir=\"ltr\" style=\"text-align:left;\">";
$after = "</div></code></div></div>";
$content = preg_replace($match, $before.highlight_string(stripslashes('$1'), true).$after, $content);
אבל כשאני מנסה להכניס קוד מסויים למסד, אם יש בקוד מרכאות(") הוא אומר שיש שגיאה
אם אני מנסה כל קוד בלי מרכאות אז הכל תקין