もう1つの配列をforeachループに追加します。ここで コードです:foreachの2つの配列
$products = array();
$products = get_cat_images();
$name = array();
$name = get_cat_name();
foreach(array_chunk($products, 3) as $arr_images) {
echo "<div class = \"row\">";
foreach($arr_images as $detail_image) {
echo "
<div class=\"col-sm-4 col-md-4\">
<div class=\"service\"> <!-- Service #1 -->
<a href=\"service/civil-architecture.html\">
<img src=\"http://elektroteni.ru/".$detail_image."\" alt=\"\" class=\"img-responsive\">
</a>
<a href=\"service/civil-architecture.html\"><h4>".$name."</h4></a>
<p>description of the product</p>
<a class=\"read-more\" href=\"service/civil-architecture.html\">Read More <span class=\"fa fa-chevron-circle-right\"></span></a>
</div>
</div>
";
}
echo "</div>";
}
だから私は、ループ内で適切に$name
配列を表示したいです。 お困りですか?
は、同様に私達にあなたの配列を示しました。 – Noman
この問題の表を示します。 –
その配列に含まれるもの –