Answer the question
In order to leave comments, you need to log in
What should the regular expression look like in my case?
What should the regular expression look like?
There is a line
10 000 руб
12 000 руб
preg_replace('/[^\d]/', '', $string);
Answer the question
In order to leave comments, you need to log in
preg_replace('/^([\s\d]+).*/is', '$1', $str);
then you can remove the spacespreg_replace('/\s+/', '', $str);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question