Reputation: 55
I forgot how to do the following or what it is called.... instead of writing the code like:
if ( $row['level'] != 1 && $row['level'] != 2 && $row['level'] != 3 )
{
}
There was a way to make the code above look better. I think it was all put into an array or something. Could you please provide me with the code to make the above look cleaner? Thanks.
Upvotes: 2
Views: 35
Reputation: 157992
Are you searching for in_array()
?
if(!in_array($row['level'], array(1,2,3))) {
}
Upvotes: 3