add in note
i have to paste 3 time the following code in the html body of a static webpage, instead of having to paste it and have a lot of code, i prefer to only have one line (3 times) that call the writing of the code, like this : <?php getgooglepub(); ?>
I like to make a php function that will ouput to the hmtl page the google analitic code or adsense.... hot to format the code to output "as is" with all the<>""''
here is the sample code to output :
<script type="text/javascript"><!--
google_ad_client = "pub-0743213818925076";
/* 728x90, date de création 11/02/10 */
google_ad_slot = "9774402576";
google_ad_width = 870;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Note, despite the creative answer, i found myselft now beeing able to make it work... for sure, my fautl.... i will copy-paste the code, for sure, you will flag the problem, since i have no clue !..
function getgooglepub()
{$google_code = <<<EOT
<script type="text/javascript"><!--
google_ad_client = "pub-0743213818925076";
/* 728x90, date de création 11/02/10 */
google_ad_slot = "9774402576";
google_ad_width = 870;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
EOT;
echo htmlspecialchars($google_code);}
after that in the html code there is the call
<?php getgooglepub(); ?>
This is the source code from the page render in firefox... abviousely not working
<script type="text/javascript"><!--
google_ad_client = "pub-0743213818925076";
/* 728x90, date de création 11/02/10 */
google_ad_slot = "9774402576";
google_ad_width = 870;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
</script>
i have read somewhere about the [data] tag ?.... it maybe a way to do that ?