php get values of array (多维)

来源:互联网 发布:医疗his软件 编辑:程序博客网 时间:2024/05/01 23:47

参考文档:   http://php.net/manual/zh/function.array-column.php

array_column  实例:

获取2维数组中的下标为id的value

$ids = D('table_name')            ->where(['status' => new \MongoInt32(1)])            ->field(['_id' => 0,'id' => 1])            ->order('_id desc')            ->limit($Page->firstRow,$Page->listRows)            ->select();        $ids = array_column($ids, 'id');