GeorgeMoney Posted September 23, 2006 Share Posted September 23, 2006 Is it possible to use a function in the regex itself? this doesnt work:[code]$datr = preg_replace("/\[SC\](.*)\[\/SC\]/i", '<a name="'.myurlen("$1").'"></a>', $datr);[/code] Quote Link to comment Share on other sites More sharing options...
extrovertive Posted September 24, 2006 Share Posted September 24, 2006 preg_replace_callback Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted September 24, 2006 Share Posted September 24, 2006 Or use the [b]e[/b] pattern modifier:[code]$datr = preg_replace("/\[SC\](.*)\[\/SC\]/ie", "'<a name=\"' . myurlen('$1') . '\"></a>'", $datr);[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.