首页 > Web开发 > 详细

PHP array_column() 函数不存在 简单自定义

时间:2019-04-04 13:10:03      阅读:220      评论:0      收藏:0      [点我收藏+]

PHP array_column() 函数不存在 array_column 是5.5新增的

自定义方法

 

if (!function_exists(‘array_column‘)) {
function array_column($arr2, $column_key) {
$data = [];
foreach ($arr2 as $key => $value) {
$data[] = $value[$column_key];
}
return $data;
}
}

 

 

转自:https://blog.csdn.net/luochengquan/article/details/66972194  感谢博主

PHP array_column() 函数不存在 简单自定义

原文:https://www.cnblogs.com/bchf/p/10654057.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!