E
El Bachir Argoub
Guest
How to echo AdSense code with PHP? Here is the sample of my code which I am working for a codeigniter php.
All I want to insert adsense code inside a div with PHP. I also tried with htmlentities along with stripslashes but ad in not getting displayed.
<p>How to echo AdSense code with PHP? Here is the sample of my code which I am working for a codeigniter php.</p>
<pre><code>$adsence = "
<div class=\"right-inner\">
<center width=\"96% class=\"img-responsive center-block\">
<script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>
<!-- quiz_net -->
<ins class=\"adsbygoogle\"
style=\"display:block\"
data-ad-client=<?php echo $client ?>
data-ad-slot=<?php echo $slot ?>
data-ad-format=\"auto\"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
</div>";
echo $adsence;
</code></pre>
<p>All I want to insert adsense code inside a div with PHP. I also tried with htmlentities along with stripslashes but ad in not getting displayed.</p>
Continue reading...
Code:
$adsence = "
<div class=\"right-inner\">
<center width=\"96% class=\"img-responsive center-block\">
<script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>
<!-- quiz_net -->
<ins class=\"adsbygoogle\"
style=\"display:block\"
data-ad-client=<?php echo $client ?>
data-ad-slot=<?php echo $slot ?>
data-ad-format=\"auto\"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
</div>";
echo $adsence;
All I want to insert adsense code inside a div with PHP. I also tried with htmlentities along with stripslashes but ad in not getting displayed.
<p>How to echo AdSense code with PHP? Here is the sample of my code which I am working for a codeigniter php.</p>
<pre><code>$adsence = "
<div class=\"right-inner\">
<center width=\"96% class=\"img-responsive center-block\">
<script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>
<!-- quiz_net -->
<ins class=\"adsbygoogle\"
style=\"display:block\"
data-ad-client=<?php echo $client ?>
data-ad-slot=<?php echo $slot ?>
data-ad-format=\"auto\"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
</div>";
echo $adsence;
</code></pre>
<p>All I want to insert adsense code inside a div with PHP. I also tried with htmlentities along with stripslashes but ad in not getting displayed.</p>
Continue reading...