How to extract all digits from a string in PHP?

In this article, To get the list of all numbers in a String, use the regular expression ‘[0-9]+’ with re.findall() method. [0-9] represents a regular expression to match a single digit in the string. [0-9]+ represents continuous digit sequences of any length.