我有一个数组,我想将它的两个字段值合并到一个字段中。需要 链接=链接+脚注
Array
(
[title] => CBS Blocks Time
[link] => http://techcrunch.com/2013/08/02/cbs-blocks-time-warner-cable-subscribers-from-watching-full-episodes-on-cbs-com/
[pubDate] => Fri, 02 Aug 2013 00:00:00 +0000
[dc_creator] => Ryan Lawler
[dc_language] => en
[dc_format] => text/html
[footnote] => Array
(
[0] => http://www.twcableuntangled.com/2013/08/twc-removes-cbs-programming/
[1] => https://twitter.com/CBS
[2] => https://twitter.com/TWC
[3] => http://CBS.com
[4] => https://twitter.com/TWC
[5] => http://twitter.com/#!/brianstelter/status/363435685249687552
[6] => http://www.techmeme.com/101016/p12#a101016p12
)
)
需要输出
Array
(
[title] => CBS Blocks Time
[link] => Array
(
[0] => http://techcrunch.com/2013/08/02/cbs-blocks-time-warner-cable-subscribers-from-watching-full-episodes-on-cbs-com/
[1] => http://www.twcableuntangled.com/2013/08/twc-removes-cbs-programming/
[2] => https://twitter.com/CBS
[3] => https://twitter.com/TWC
[4] => http://CBS.com
[5] => https://twitter.com/TWC
[6] => http://twitter.com/#!/brianstelter/status/363435685249687552
[7] => http://www.techmeme.com/101016/p12#a101016p12
)
[pubDate] => Fri, 02 Aug 2013 00:00:00 +0000
[dc_creator] => Ryan Lawler
[dc_language] => en
[dc_format] => text/html
)
这是我的方法
$result = array();
foreach($item as $val){
foreach($item['footnote'] as $val1){
$result['link'] = $val1;
}
}
pr($result);