Categories
How to cut a word from a string?
There is a string, for example: Нажми кнопку и получи @приз, чтобы принять участие We need to get from it the word after the symbol @(ie, in this case, "prize"). How to do it?
Нажми кнопку и получи @приз, чтобы принять участие
@
Answer the question
In order to leave comments, you need to log in
preg_match('~(?<[email protected])\w+~u', $str, $match);
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question