Substr PHP
I have a string like this http://domain.sf/app_local.php/foo/bar/33.
The last caracters are the id of an element. His lenght could be more than one so i can not use:
substr($dynamicstring, -1);
In this case must be
substr($dynamicstring, -2);
How can i get the caracters after "/bar/" on the string without depending on the length?