I have a link, something like this:
$link = 'http://www.example/data/showall.php?quantity=&lang=eng&sura=2&ayat=21';
Now I want the first number of it, In this case I want 2
.
Note: All characters are fixed except the numbers.
To simplify my string, I can replace the first of it with empty, something like this:
$link ='2&ayat=21';
Now I want 2
.
I can do that by regex: /\d+/
. But I don't want to remove it, I want it,
how can I do this ?