quote:
Originally posted by SonicSam
php code:
<?php
$one = "monkey";
$two = "baguette";
>>> $one_array = array_map('rtrim',file('one_list.txt')); <<<
>>> $two_array = array_map('rtrim',file('two_list.txt')); <<<
if (in_array($one,$one_array)) {
echo"one present!<br />";
if(in_array($two,$two_array)){
echo"two present!";
}
else{
echo"two missing!";
}
}
else{
echo"one missing!";
}
?>
rtrim — Strip whitespace (or other characters) from the end of a string
array_map — Applies the callback to the elements of the given arrays
i won the game
http://sonicsam.net/quest.php
YAY! You win! Have a cookie
Thankles very much Sam! =)