php 原生态,返回数组的的某一列或者某几列的的写法
原生态,返回数组的的某一列或者某几列的的写法 [代码片段(31行)]
<?php
// 获得纪录的数据
//这个是php最新的一个数组函数
$records = array(
array(
'id' => 0,
'pre' => 2,
'next' => 6,
),
array(
'id' => 1,
'pre' => 13,
'next' => 18,
),
array(
'id' => 3,
'pre' => 3,
'next' => 8,
),
array(
'id' => 4,
'pre' => 0,
'next' => 5,
)
);
$all_pre = array_column($records, 'pre');
//打印出所有的前驱节点
print_r($all_pre);
?>
//该片段来自于http://outofmemory.cn
精彩图集
精彩文章






