PHP中未定义的偏移量99171

I got this Undefined Offset error from PHP, and I can't seem to see why. Can you guys help me out?

I'm pretty new to PHP, so I don't really understand what Undefined offset really is.

<?php

$wordlist = file('/tmp/all'); // 42M wordlist

$user = "admin";
$realm = "Miele Logic";
$nonce = "07ec2416ef0000009223000015000000";
$nc = "00000001";
$cnonce = "gdBxXVNT0y6npOpQ";
$qop = "auth";

$i = 0;
while($wordlist[$i]) {

    $password = trim($wordlist[$i]);



    $HA1 = md5("$user:$realm:$password");
    $HA2 = md5("GET:/");

    $response = md5("$HA1:$nonce:$nc:$cnonce:$qop:$HA2");

    if($i % 100000 == 0) {

        echo "$i
"; // output $i at each 100k
    }

    if($response == '97b5e79866512f028266f34946117a2c') {

        echo $password . "n";
        break;
    }
    $i++;
}
?>

Change your code to:

$i = 0;
$count = count($wordlist);
while($i < $count) {
    //rest of the code goes here
}