php 如何取二维数组中某个值,并组合成另一个一维数组进行implode
Array([0]=>Array([id]=>100334[name]=>tom)[1]=>Array([id]=>100336[name]=>jeff)[2]=>Arr...
Array
(
[0] => Array
(
[id] => 100334
[name] => tom
)
[1] => Array
(
[id] => 100336
[name] => jeff
)
[2] => Array
(
[id] => 100338
[name] => mary
)
[3] => Array
(
[id] => 100411
[name] => peter
)
)
如何做成一维数组?
最终再用implode变成
$num = 100334,100336,100338,100411 展开
(
[0] => Array
(
[id] => 100334
[name] => tom
)
[1] => Array
(
[id] => 100336
[name] => jeff
)
[2] => Array
(
[id] => 100338
[name] => mary
)
[3] => Array
(
[id] => 100411
[name] => peter
)
)
如何做成一维数组?
最终再用implode变成
$num = 100334,100336,100338,100411 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏15(财富值+成长值)
展开全部
<?php
$array=array('0'=>array('name'=>'aaa','id'=>'22222'),'1'=>array('name'=>'bbb','id'=>'333'));
$new = array();
foreach ($array as $v){
$new[]=$v['id'];
}
$num = join(',',$new);
echo $num;
?>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询