回覆列表
  • 1 # Gxdc

    $arr=array(0=>array( "tid"=>26,"tname"=>"內衣","id"=>1),1=>array("tid"=>25,"tname"=>"女裝","id"=>1),2=>array("tid"=>27,"tname"=>"男裝","id"=>2),3=>array("tid"=>28,"tname"=>"運動","id"=>2),4=>array("tid"=>29,"tname"=>"戶外","id"=>2),5=>array("tid"=>30,"tname"=>"男鞋","id"=>3),6=>array("tid"=>31,"tname"=>"女鞋","id"=>3),7=>array("tid"=>32,"tname"=>"個人化妝","id"=>4),);$item=array();foreach($arr as $k=>$v){if(!isset($item[$v["id"]])){$item[$v["id"]][]=$v;}else{$item[$v["id"]][]=$v;}}print_r($item);

  • 中秋節和大豐收的關聯?
  • ABCC型的詞語?