I have seen two similar questions on SO here & here but still stuck...
I have a string of filepath like catalog/reviews/249532-20691-5369.jpg
and i want to get numbers only like 249532-20691-5369
.
I am using the following approach:
$id1 = explode('/', $image['img_link']);
$id2 = explode('.', $id1[2]);
echo $id2; //output 249532-20691-5369
Is there any best approach to do this task in controller.