Extension talk:AdsWherever/Archive 1
This page is an archive. Do not edit the contents of this page. Please direct any additional comments to the current talk page. |
It would be easier and handier to paste HTML and JavaScript code "as is" using nowdoc that doesn't require quoting:
// Google Adsense Example
$ad['goo1'] = <<<'EOAD'
<div class="thumbnail"><div id="ads">
<script type="text/javascript"><!--
google_ad_client = "Your Publisher ID";
google_ad_slot = "The Ads slot number";
google_ad_width = ;
google_ad_height = ;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div>
EOAD;
This works starting with PHP 5.3.0. But in older PHP versions using heredoc is still possible too after carefully escaping special characters \ and $ in:
// Google Adsense Example
$ad['goo1'] = <<<EOAD
<div class="thumbnail"><div id="ads">
<script type="text/javascript"><!--
google_ad_client = "Your Publisher ID";
google_ad_slot = "The Ads slot number";
google_ad_width = ;
google_ad_height = ;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div>
EOAD;