Logical OR
if (empty($user_id) || in_array($user_id, $banned_list))
Logical AND
if (file_exists($filename) && filetime($filename) > time())
{
}
Not Equal
if ($domain !== 'somedomain.com')
{
}
When return value can be boolean or an integer
Use if ($ReturnValue === false) or $ReturnValue !== false)
If with load of a return value into a variable
Ensure you enclose the assignment in brackets or it won’t work correctly
if (($MyVariable = SomeFunction()) > -1)
{
//$MyVariable contains the return value
}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.