Answer the question
In order to leave comments, you need to log in
How can I access the user through regexp?
What regular expression for preg_replace should be written to replace @username with a link in the string? those. there is an example code:
$str_search = ""; // ?
$str_replace = '<a href="/$1">$1</a>';
$text = "Пользователь @username - перейти";
preg_replace($str_search, $str_replace, $text);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question