Hello. I translate sites on PHP and there such a construct is used in template engines. How do I convert it to preg_replace_callback? Already what options just did not try again
$in["#\\[index:(.+?)\\](.*?)\\[/index\\]#ies"] = "indexShow('\\1', '\\2')"; $in["#\\[modules:(.+?):(.+?)](.*?)\\[/modules]#ies"] = "modulesShow('\\1', '\\2', '\\3')"; $in["#\\[guest](.*?)\\[/guest]#ies"] = "checkGuest('\\1')"; $in["#\\[user](.*?)\\[/user]#ies"] = "checkUser('\\1')"; $in["#\\[title:(.*?)]#ies"] = "\$this->preTitle('\\1');"; $in["#\\[open](.*?)\\[/open]#ies"] = "\$this->preOpen('\\1');"; $in["#\\[userinfo:(.*?)]#ies"] = "\$this->ustinf('\\1')"; $text = preg_replace(array_keys($in), array_values($in), $str); Please help me to transfer from preg_replace to preg_replace_callback, I have already done various options, it does not help.
e. - Vismanpreg_replace()function ispreg_replace(), but what I wrote in the comment above. - Visman