I have strings:
$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 can I find the numeric digits in these strings?
Maybe with function:
function numbers($string){
// ???
$first = ?;
$second = ?;
}
For example:
function numbers($one){
// ???
$first = 4;
$second = 5;
}
function numbers($two){
// ???
$first = 2;
$second = NULL;
}
Best way for this maybe is regex, but how can I use this for my example? Maybe without regex?