╃巡洋艦㊣ 2011-03-08 13:24:07 7886次浏览 5条回复 2 1 0

a数组

Array ( 
[0] => Array ( 
 [CateID] => 110 [CateName] => 资讯头条
) 
[1] => Array ( 
 [CateID] => 111 [CateName] => 专家观点 
) 
[2] => Array (
 [CateID] => 112 [CateName] => 产品点评 ) 
)

数组

Array ( [0] => 110,[1] => 111,[2] => 112 );

由a数组,转换为b数组,方法如下:

foreach($a as $key=>$value)
{
  $b[$key]=$value['CateID'];
}
觉得很赞
您需要登录后才可以回复。登录 | 立即注册