humm, , , . . IF . ad_status 1 4, -3 .
, , , , :
$status = $getadstatus['ad_status'];
if ( !( $status==1 || $status==4 ) )
{
return -3;
}
, ! (not) OR, . , , , . , , , not (!).
:
The more approaches are part of a condition or expression, the more difficult it becomes. But the more often you formulate difficult conditions, the better you will cope with them. To train, you can always break the conditions into several lines and assign labels (variables) to your part:
$status = $getadstatus['ad_status'];
$statusIs1or4 = $status==1 || $status==4;
$statusIsNot1or4 = !$statusIs1or4;
if ($statusIsNot1or4) return -3;
For production code, this may be excessive, but, as always, authors choose how to write something, you can do whatever the language allows.
hakre source
share