[PHP]
for($i = 0; $i<$size; $i++)
{
if("$description[$i]" == $_POST['cat'])
{
echo "SUCCESS";
}
else
{
echo "FAIL";
}
}
[/PHP]
But I keep getting a string of FAIL's
$description[$i] is taking lines of text out of a text file (about 5 lines)
$_POST['cat'] contains a selection from a drop down menu, using information created from the same text file.
If I were to put in the line of code:
[PHP] echo $description[$i] ." ?= ". $_POST['cat']. "<BR>";[/PHP]
right before my if statement I get:
Help Desk hours ?= Help Desk hoursSo the strings of text match, but it never returns SUCCESS, unless I type in "Help Desk hours" in place of $description[$i] (assuming I choose Help Desk hours to send into $_POST['cat'] )
sales Call ?= Help Desk hours
Help with buying new laptop ?= Help Desk hours
location of software ?= Help Desk hours
Where am I going wrong with this?