Y
Y
yischyk2021-07-24 22:59:43
PHP
yischyk, 2021-07-24 22:59:43

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

1 answer(s)
0
0xD34F, 2021-07-24
@yischyk

preg_match('~(?<[email protected])\w+~u', $str, $match);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question