二维数组值
function value($array)
{
$data = [];
foreach ($array as $key => $value) {
$data[] = array_values($value);
}
return $data;
}
二维数组翻转
function reverse($array)
{
$data = [];
for ($i = count($array)-1; $i > 0; $i--) {
$data[] = $array[$i];
}
return $data;
}
二维数组转置
function rotate($array)
{
$data = array();
foreach($array as $values){
foreach($values as $key => $value) {
$data[$key][] = $value;
}
}
return $data;
}
网友评论