Warning: Wrong parameter count for fgets() in /www/wordcheck/wordcheck.php on line 5
The word is valid
Warning: Wrong parameter count for fgets() in /www/wordcheck/wordcheck.php on line 5
The word is valid
I'm trying to create a simple word verifier
using a list of words from 2 letters to 10 letters. in a txt file like so:
AE
AU
AX
AAC
ABC
ADC
if its in the list i need a "yes" if its not i need a "no" The code i have tried returns the above error in a never ending loop it seems.
<?php
$file = "wordlist.txt";
$fd = fopen($file, "r");
while (!feof($fd)) {
if (fgets($fd) == $input) {
print "The word is valid";
}
}
fclose($fd);
print "The word was not found, and so is not valid";
return;
?>
Any pointers help would be appreciated
Pete.