search associative array by value

后端 未结 7 2096
感动是毒
感动是毒 2020-12-09 15:40

I\'m fetching some JSON from flickrs API. My problem is that the exif data is in different order depending on the camera. So I can\'t hard-code an array number to get, for i

7条回答
  •  一个人的身影
    2020-12-09 16:19

    This would be fairly trivial to implement:

    $model = '';
    
    foreach ($exif['photo']['exif'] as $data) {
        if ($data['label'] == 'Model') {
            $model = $data['raw']['_content'];
            break;
        }
    }
    

提交回复
热议问题