I want to make mentions similar to Twitter but for the user profiles i use ID not userNames so i creat a function that get the UserID based on userName and in a procedural code is working but in oop dosent ..
$title = ' Hey @Stackoverflow can u help me ?';
$mentions = (preg_replace("/\@([a-zA-Z0-9\-_]{3,30})/e",
"'<a href=\"http://mySite.com/user:'.$this->mentionName('$1').
'\">@$1</a>'",$title));
expected url result
not expected result
http://mySite.com/user:Stackoverflow
// This is a loop not a single string
ewiki.php.net/rfc/remove_preg_replace_eval_modifier