PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello everyone and again TY in advance for any help/suggestions. This code won't work for me, is the syntax incorrect? If I echo the variables before the if loop there are values stored in them.
Strings evaluate to false if they are equivalent to boolean false (pretty much just the string "0"). Anything else evaluates to TRUE. Your string, though it contains characters a human would view as boolean conditions, is just treated like any other string & will always return TRUE
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
<?php
if ($Visitor==$team) // If the visitior is the team...
{
//do some code if the visitor is the team..
}
elseif ($Home == $team) //or if the home is the team..
{
//do some code here if the home is the team...
}
?>
I'm just trying to reuse the same code. If either home or visitor is true do the code otherwise loop to next element in array. I didn't think I would run into a problem with the $dothis"..." assignment. for the If loop.