1
我在Yii實施我的項目,我打電話給Google廣告。它正在顯示,但應根據條件顯示。根據條件動態發佈多條Google廣告
我從數據庫動態調用數據,我打電話給圖像的內容。在顯示一個廣告之後,將顯示10個類別食譜,但是僅在該廣告顯示爲空白之後才顯示一次。
我在這裏寫了我的代碼,請建議我如何修復此代碼。我希望每顯示一個Google廣告的十個類別。
<?php $counter=0; $count123=0; ($posts as $receipe):?> <div class="post">
<?php $counter=$counter+1;
if($count123<4 && $counter==9)
{ ?>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-11 wrdLatest" id="imgcontent_rand_recipe">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" id="kraftmonsterresponsive"
style="display:block"
data-ad-client="xxxxxxxxxxx"
data-ad-slot="xxxxxxxxxxxxxxxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<?php
$counter=1;
$count123=$count123+1; ?> </div>
<?php } ?>