我怎样才能组合2个数组...:
$array_1 = [['title' => 'Google'], ['title' => 'Bing']];
$array_2 = [['link' => 'www.example1.com'], ['link' => 'www.example2.com']];
为了得到 ... :
$array_3 = [
['title' => 'Google', 'link' => 'www.example1.com'],
['title' => 'Bing', 'link' => 'www.example2.com']
];
我想$array_3应该按以下方式构建才能得到:
最后结果:
Google - See website
Bing - See website
得到最终结果的函数:
function site_and_link($array_3) {
foreach ($array_3 as $a) {
echo $a['title'] . " - <a href=" . $a['link'] . ">See website</a></br>";
}
}
缺少什么安排步骤$array_3?
烙印99
红颜莎娜