为什么我的PHP while循环在某一点之后停止


Why does my PHP while loop stop after a certain point?

当我运行脚本时,输出在第397行停止,即输出看起来像"397"。0e4001"。链接到脚本结果。为什么脚本停止?它应该继续,直到符合标准。

<?php
$key = "iwrupvqb";
$num = 0;
$str = "";
while ($str != "000000") {
    $hash = md5($key . $num);
    $str = substr($hash, 0, 6);
    echo $num . ". " . $str . "</br>";
    $num++;
}
?>

正如John Conde所指出的,问题在于比较运算符,即需要将其从到!==。