I'm writing an application in PHP, and I need to replace any word between <!-- *
and * -->
with it's correspondenting element in $vars
.
For example,
<!-- *foobar* -->
Bu durumda, 'filanca' değişken $vars["foobar"]
'nin değeri ile değiştirilmesi gerekir. Bu ne var şimdi, ama çalışmak (her zaman döndürür <>
değil: ():
preg_replace_callback("<!--(\s+)\*([a-zA-Z0-9]+)\*(\s+)-->", create_function('$matches', 'return $vars[$matches];'), $template);
Herkes bana yardımcı olabilir misiniz? Şimdiden teşekkürler.