my array: $pupupu = array("admin","moderator"); If($level == $pupupu) { blabla } The thing is. It does not work. It would only work as $pupupu[0] and $pupupu[1], but how can I make it that both will be called up with just pupupu? So pupupu would be admin or moderator.
you can do foreach foreach($pupupu as $arraysss) { if($arraysss == $level) { code here... } } or $key = array_search($level, $pupupu); $key will return any dimension in the array $pupupu if found
maybe this is what you seek for $pupupu=array(...); foreach ($pupupu as $pupu): if($level=$pupu){ blabla } endforeach; PHP:
So I think you want to check if the $level contains any one of the value in $pupupu $pupupu = array("admin","moderator"); if(in_array($level,$pupupu) ) { //blabla } PHP:
$pupupu = array( "admin" => true, "moderator" => true ); if(isset($pupupu[$level])) { } Code (markup):