任何人都可以告诉我为什么这段代码适用于第二行而不是第一行,尽管它们是相同的?
这是 pass.txt 文件:
01234567 5f4dcc3b5aa765d61d8327deb882cf99
01234567 5f4dcc3b5aa765d61d8327deb882cf99
这是代码:
<?php
$f = fopen("pass.txt", "r");
if ($f) {
$buffer = fgets($f);
$buffer = fgets($f); //Comment out this line to read the first line
$token = explode(' ', $buffer);
if ($token[1] == hash('md5', 'password'))
echo "Password correct";
else
echo "Password incorrect";
}
?>