I have path field in mysql table which stors the path of the page.
It is having page id at the end like 33, 31, 121 ...
How can I write a query to get only the ids?
Path
-----
trending-architectures/architecture_detail_page/31
trending-architectures/architecture_detail_page/33
trending-architectures/architecture_detail_page/33
trending-architectures/architecture_detail_page/33
trending-architectures/architecture_detail_page/33
preg_match_all------------------------preg_match_all('!\d+!', $str, $matches); print_r($matches);or else you can even usepreg_match_all("/[^0-9]/","",$str,$matches); print_r($matches);/and the last value after/is a number ?