I have the following URL: www.exampe.com/id/1234, and I want the regular expression to get the id parameter value, which in this case is 1234 .
I tried
<?php $url = "www.exampe.com/id/1234"; preg_match("/\d+(?<=id\/[\d])/",$url,$matches); print_r($matches); ?>
and got Array ( [0] => 1 ) , which only displays the first digit.
The question is, how do I rewrite the regex to get all the numbers with a positive appearance?
source share