If you use substr
you have to use it in conjunction with strpos
because substr
needs to know string indexes.
Yes, you are better off with a regex.
If your question is how to extract the digits from a string 00000ddddddd.jpg (for some number of zeros and non-zero digits) anywhere in a string, then you should use preg_match.
Here is a complete example which you can try on http://writecodeonline.com/php/
preg_match('/([1-9][0-9]+)\.jpg/', "I have a file called 0000482080.jpg somewhere", $matches);
echo "I like to call it: {$matches[0]}";
If the entire string is a filename, then use intval
or casting as suggested in the other answers.