views:

34

answers:

1

Hi All,

I have a $GLOBALS['plugins'] array. With these values:

Array
(
    [0] => Array
    (
        [0] => calendarFuncs/
        [1] => calendar.php 
        [2] => Calendar
    )
    [1] => Array
    ( 
        [0] => eventFuncs/ 
        [1] => todo.php 
        [2] => Projects
    )
    [2] => Array
    (
        [0] => financeFuncs/ 
        [1] => finance.php 
        [2] => Finances 
    )
    [3] => Array
    ( 
        [0] => crmFuncs/ 
        [1] => crm.php 
        [2] => CRM
    )
    [4] => Array
    ( 
        [0] => adminFuncs/ 
        [1] => admin.php 
        [2] => Admin
    )
)

This returns false, always...

in_array('Projects', $GLOBALS['plugins'])

Any thoughts?

Thank you.

+2  A: 

in_array() doesn't search recursively through multidimensional arrays.

You could loop through the $GLOBALS['plugins'] array and do in_array() on each item inside instead.

BoltClock