PDA

View Full Version : simple php formatting question



viktor
06-13-2008, 06:00 PM
hey,

i'm missing something here, can't figure out what. I'm learning php slowly so, I really do appreciate help.


$output = "<script type=\"text/javascript\">
var gaJsHost =\ (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript'%3E%3C/script%3E"));\n";


What I'm trying to do is put this Analytics code:


<script type=\"text/javascript\">
var gaJsHost =\ (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript'%3E%3C/script%3E"));>



Into $output = " "

Thanks guys,
viktor

Nile
06-13-2008, 08:52 PM
This should work for you:


$output = <<< OUT
<script type=\"text/javascript\">
var gaJsHost =\ (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript'%3E%3C/script%3E"));n
OUT;