Extract filename with extension from filepath string
For more general needs, use negative value for start parameter.
For e.g.
<?php$str = '001234567890';echo substr($str,-10,4);?>
will output
1234
Using a negative parameter means that it starts from the start'th character from the end.