我在 foreach 循环中有这个数组
foreach ($data as $key => $value) {
$filter_cat_name = $this->filter_cat_name($value['filter_cat_id']);
$filter_sub_cat_name = $this->filter_sub_cat_name($value['sub_cat_id']);
$var = array($filter_cat_name,$filter_sub_cat_name);
print_r($var);
}
//foreach output
Array ( [0] => Brand Name [1] => Sony )
Array ( [0] => Brand Name [1] => nokia )
Array ( [0] => Display Size [1] => 360 x 640 )
Array ( [0] => Brand Name [1] => Samsung )
Array ( [0] => Display Size [1] => 480 x 640 )
我怎样才能像这样格式化或更改
品牌名称
索尼
诺基亚
三星显示尺寸
360 x 640
480 x 640