in_array() and multidimensional array

前端 未结 22 1696
眼角桃花
眼角桃花 2020-11-22 00:30

I use in_array() to check whether a value exists in an array like below,

$a = array(\"Mac\", \"NT\", \"Irix\", \"Linux\");
if (in_array(\"Irix\"         


        
22条回答
  •  一个人的身影
    2020-11-22 01:20

    This is the first function of this type that I found in the php manual for in_array. Functions in the comment sections aren't always the best but if it doesn't do the trick you can look in there too :)

    in_multiarray( $elem, $array_element ) )
                     {
                         return TRUE;
                         exit;
                     }
                 }
             }
    
             // if isn't in array return FALSE
             return FALSE;
        }
    ?>
    

提交回复
热议问题