本文介绍了使用关联数组作为值来移动多维数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个数组,想得到一个扁平数组中的值和键请帮助,
数组([0] =>数组([DT] => 4 [NO_Calls] => 300 [代理商] => 8001)[1] =>数组([DT] => 4 [NO_Calls] => 6000 [代理商] => 8002))
这是mysql的代码
i have this array and would like to get the values and keysin a flat array please help,
Array ( [0] => Array ( [DT] => 4 [NO_Calls] => 300 [Agents] => 8001 ) [1] => Array ( [DT] => 4 [NO_Calls] => 6000 [Agents] => 8002 ) )
this is the code for mysql
public function selectJ($query) {
$rows = array();
$result = $this -> db_query($query);
if($result === false) {
return false;
}
while ($row = mysqli_fetch_assoc( $result)) {
$rows[] = $row;
}
return $rows;
}
i希望它是这样的东西
数组([DT] => 4 [NO_Calls] => 300 [代理商] => 8001 [ DT] => 4 [NO_Calls] => 6000 [代理商] => 8002)
i would like it to be something like this
Array ( [DT] => 4 [NO_Calls] => 300 [Agents] => 8001 [DT] => 4 [NO_Calls] => 6000 [Agents] => 8002 )
推荐答案
这篇关于使用关联数组作为值来移动多维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!