>>6
あ、「一番番号が若いファイル名」だった、勘違いめんご。
しかもis_dirの間違いだし…

while ($file = readdir($dir)) {
if(! is_file($file)) continue;

if( strnatcmp($num_max,$file) < 0 ) $num_max = $file;
}

print $num_max;

辞書順比較ってのはこれ使います。perlだとcmpだったかな?
http://www.php.net/manual/ja/function.strnatcmp.php