How can I extract the number 19 from the string product_27001_th19.jpg . The solution needs to be dynamic, as the function should return 19 for all the following:
product_2_th19.jpg
product_gf_th19.jpg
product_2704401_th19.jpg
I am perl programmer and not sure how to do this in php.
Thanks.
Roy
my ($number) = $filename =~ m/(\d+)\.[^.]+$/;
.....
update: oops, you wish to do that in php....