I m trying to create a function that searches through the user input to see if they have entered the name of a day. For some reason, this function only seems to return true if any two day names have been entered. This could be something simple, but I can t seem to figure it out.
我的守则是:
<?php
if(isset($_POST[ query ]))
{
$query=$_POST[ query ];
$dow=array( monday , tuesday , wednesday , thursday ,
friday , saturday , sunday );
foreach($dow as $day)
{
if(stripos($query, $day)==FALSE)
{
}
else
{
echo"hurray";
}
}
}
?>
<html>
<form action="datefunctiontester.php" method="post">
<p>Search</p><input type="text" name="query">
<input type="submit">
</form>
</html>