php多维数组
有两张表shangpin(商品表),stype(商品类)。我想把两个表的数据合并输出多位数组。如:商品类title水果id1....商品表id1title苹果typrid...
有两张表 shangpin(商品表),stype(商品类)。我想把两个表的数据合并输出多位数组。如: 商品类 title 水果 id 1 .... 商品表 id 1 title 苹果 typrid 1 ....
输出结果是这样的
$info=array(
"水果"=>array(
array(1,"苹果",1,"5元"),
array(1,"苹果",1,"5元"),
array(1,"苹果",1,"5元"),
),
"蔬菜"=>array(
array(1,"白菜",2,"3元"),
array(1,"白菜",2,"3元"),
array(1,"白菜",2,"3元"),
),
);
php怎么实现这个数组效果。 展开
输出结果是这样的
$info=array(
"水果"=>array(
array(1,"苹果",1,"5元"),
array(1,"苹果",1,"5元"),
array(1,"苹果",1,"5元"),
),
"蔬菜"=>array(
array(1,"白菜",2,"3元"),
array(1,"白菜",2,"3元"),
array(1,"白菜",2,"3元"),
),
);
php怎么实现这个数组效果。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询