I have no idea what i'm doing wrong with the if statement, I changed it so many ways. No matter what the word is it keeps going to True....Probably something simple and i'm not seeing it...while($j < $i){ if ($final[$j] == "Interval" || "Large") { echo "True$final[$j]"; }else{ echo "false$final[$j] $whitespaceten $final[$k] $whitespaceten $final[$l]<br>"; ++$l; ++$k; } $m=$j; ++$j; }
10/21/2008 10:19:29 AM
order of operationsit is equivalent to if( ($final[$j] == "Interval") || ("Large"))"Large" by itself will evaluate to true. also, use strcmp on both stringsif (!strcmp($final[$j], "Interval") || !strcmp($final[$j], "Large"))[Edited on October 21, 2008 at 10:25 AM. Reason : .]
10/21/2008 10:22:18 AM
forgot to mention i just used two words but i want to compare that one word to like 20 different words.
10/21/2008 10:26:08 AM
if(in_array($final[$j], array("Interval", "Large", "so on", "so forth", "etc")))
10/21/2008 10:27:40 AM
oh thanks a lot.
10/21/2008 10:30:30 AM
You're welcome.
10/21/2008 10:50:11 AM