define extract? do you need to remove all numbers? or get all numbers?
one time I would use preg_match regex101.com/r/QZlV0L/1 the other time preg_replace.
but it heavily depends on the string structure maybe preg_match is just the hardcore variant ;)
Agnius Vasiliauskas
php-dev
Well, depends on string format. It may be enough of
explode()call or if your string is more complex - then you may needpreg_match_all(). In the very rare cases, when you don't have a pre-defined number format or you don't know what is number and what is not BEFORE string parsing - you may need a full scale string parsing with some state machine analyzing string in chunk-by-chunk fashion until you are done appending found data into array.