如何在php中获取数组元素isMultiple

时间:2016-06-04 09:09:30

标签: php arrays

嗨,我是php的新手,我想访问数组的 isMultiple 元素我该怎么做然后我想显示 isMultiple 的值是1然后它应该显示 ..任何帮助将不胜感激,它会很棒...... !!

Array
(

    [result] => Array
        (
            [0] => Array
                (
                    [pkFeatureTypeId] => 72
                    [Name] => 
                    [Status] => 0
                    [isMultiple] => 1
                    [isSpecial] => 1
                    [Order] => 0
                )

            [1] => Array
                (
                    [pkFeatureTypeId] => 32
                    [Name] => 
                    [Status] => 0
                    [isMultiple] => 1
                    [isSpecial] => 1
                    [Order] => 0
                )

            [2] => Array
                (
                    [pkFeatureTypeId] => 33
                    [Name] => 
                    [Status] => 0
                    [isMultiple] => 1
                    [isSpecial] => 1
                    [Order] => 0
                )

            [3] => Array
                (
                    [pkFeatureTypeId] => 35
                    [Name] => 
                    [Status] => 1
                    [isMultiple] => 1
                    [isSpecial] => 1
                    [Order] => 0
                )

        )

)

1 个答案:

答案 0 :(得分:2)

试试这个。

foreach($data['result'] as $item){
   if($item['isMultiple'] == '1'){
      echo 'Yes';
   }
}