transparencia Posted March 28, 2009 Share Posted March 28, 2009 There is this code inside an array: $data[0] = "<p style=\"color: #000000;font-family: Arial, sans-serif;font-size: 11px;...." I would like to paste the Javascript adsense code in this variable $data[0] but the adsense javascript needs a specific format and if that format is changed, it doesn't output the ad. The adsense script is this: <script type="text/javascript"><!-- google_ad_client = "pub-000000000000"; /* mp3 player */ google_ad_slot = "0000000000"; google_ad_width = 125; google_ad_height = 125; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> I believe I need to put it in one line and escaped like this: ]<script type=\"text/javascript\"><!-- google_ad_client = \"pub-000000000000\"; /* mp3 player */ google_ad_slot = \"0000000000\";google_ad_width = 125; google_ad_height = 125; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script> But this however doesn't output the ad, too. Any help? Quote Link to comment Share on other sites More sharing options...
Salkcin Posted March 29, 2009 Share Posted March 29, 2009 wrap it in single quotes instead, this way you dont have to escape every singe double quote, ex: $data[0] = '<script type="text/javascript"><!-- google_ad_client = "pub-000000000000"; /* mp3 player */ google_ad_slot = "0000000000"; google_ad_width = 125; google_ad_height = 125; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; Quote Link to comment Share on other sites More sharing options...
transparencia Posted March 29, 2009 Author Share Posted March 29, 2009 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.