當前我想從數據庫輸出數據。我有兩個單獨的數組。我可否知道有沒有辦法將這些陣列組合起來。代碼如下,PHP在一個循環中組合數組
$array_1 = [
'memo' => 'title string',
'break_down' => 'title string',
'images' => 'title string',
'email_content' => 'title string'
];
// content from db
$array_2 = [$memo, $break_down, $images, $email_content];
// I want it to display like this
<?php foreach ($array_1 as $key=> $name) : ?>
<p>
<?= $name; ?> = <?php //content on $array_2 ?>
<?php //eg: title string = $memo and so on.. ?>
</p>
<?php endforeach ?>
您應該嘗試**自己編寫代碼**。在[**做更多的研究**之後](https://meta.stackoverflow.com/q/261592/1011527)如果你有問題**發佈你已經嘗試了**的**明確的解釋不工作**並提供[最小,完整和可驗證示例](http://stackoverflow.com/help/mcve)。閱讀[如何問](http://stackoverflow.com/help/how-to-ask)一個很好的問題。請務必[參觀](http://stackoverflow.com/tour)並閱讀[this](https://meta.stackoverflow.com/q/347937/1011527)。 –