>>224
もう正規表現でええやん。

$str = '28habcpt918';
if (preg_match('/([0-9]+)$/', $str, $matches)) {
$format = sprintf('%05d', $matches[1]);
echo $format;
}