1.判断二维数组 是否存在某个值 array_column in_array
//身份标签
$identity = [];
$is_good_comment = db('Comment')
->field('ID')
->where('ObjectID', $person['id'])
->where('ParentID', 0)
->where('Type', 1) // 外部评价
->where('Score', 5)
->where('Status', 1)
->find();
$person_photo = db('File')
->field('ID,Description,SubType')
->where('OwnerID', $person['MyUserID'])
->where('Type', 'personphoto')
->where('(SubType IN (2,3,4,5))')
->where('Status', 0)
->order('SubType')
->select();
//--------------------------------
$subtype_list= array_column($person_photo,'SubType');
if($is_good_comment || in_array(2, $subtype_list) || in_array(3, $subtype_list
常见数组使用场景
最新推荐文章于 2024-06-13 00:25:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)