Reputation: 337
So I have an in_array check, called
if (in_array('pageLevel',$userlevels))
Which I want to connect to a boolean, like $hasAccess
so I can apply
if ($hasAccess == true) { do something }
I tried if (in_array('pageLevel',$userlevels)) { $hasAccess == true }
but that does not seem to work. Can anyone tell me how to use this?
Upvotes: 0
Views: 536
Reputation: 46607
Try $hasAccess = true;
You need to assign to the variable (=
), rather than just compare it (==
) and throw the result away.
Upvotes: 1
Reputation: 48284
$hasAccess == true
Should be $hasAccess = true
. Or
$hasAccess = in_array('pageLevel',$userlevels);
Upvotes: 3