Is this a valid syntax in php? I want a call to be done if these two conditions are met.
if($valuear[$i] < $rake) and ($winuser != $winar[$i])
Thanks.
Is this a valid syntax in php? I want a call to be done if these two conditions are met.
if($valuear[$i] < $rake) and ($winuser != $winar[$i])
Thanks.
No, it isn't
if (($valuear[$i] < $rake) && ($winuser != $winar[$i]) ){}
You must wrap the whole condition in brackets.
This could help you:
and : &&
or : ||
This is the valid way :
if($valuear[$i] < $rake && $winuser != $winar[$i])
Set the brackets in this way:
if($valuear[$i] < $rake and $winuser != $winar[$i])
http://php.net/manual/en/control-structures.if.php
The basic syntax is:
if (expr)
statement
you will get syntax error for what you have done
if($valuear[$i] < $rake) and ($winuser != $winar[$i])
It should be
if(($valuear[$i] < $rake) and ($winuser != $winar[$i]))
^ ^