I have lines:
$one = 'foo bar 4 baz (5 qux quux)'; $two = 'bar baz 2 bar'; $three = 'qux bar 12 quux (3 foo)'; $four = 'foo baz 3 bar (13 quux foo)';
How to find numerical digits in these lines?
Possible with function:
function numbers($string){
For example:
function numbers($one){ // ??? $first = 4; $second = 5; } function numbers($two){ // ??? $first = 2; $second = NULL; }
The best way to do this might be regex, but how can I use this for my example? Maybe without regular expression?
php regex
Daniel Pairen
source share