tags:

views:

37

answers:

2

i have an array which could look like this:

 $config[$name][$array]['key'] = 'value'; // here it's an array

or

 $config[$name][$array] = 'value'; // here it's not an array

i want to check if the second array key ('array') is an array or not.

could someone help me?

+7  A: 

use the function is_array http://php.net/manual/en/function.is-array.php

if(is_array($config[$name][$array])) echo "Yup I'm an array";
Lizard
+2  A: 

PHP has a built in function, is_array. That should let you know whether or not you have an array, or a plain string.

Nick Presta