开发者

how to check if the second array key is an array?

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') 开发者_Python百科is an array or not.

could someone help me?


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";


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜