Hey guys,
I am new here (and somewhat new to coding in general, though I am getting the hang of it). I searched php help forums on Google and ended up here. ANYWAY... I really hope you guys can help me out, I'd love to contribute to this forum every day
Okay, on to my question...
Is there any way that I can ECHO a variable into another variable? I don't mean like $var = $var2 (that would be pointless), I mean something like $var = echo $var2. Is there a function for that? The reason that I need to do this is...
My variable contains javascript, like so:
$url='http://www.esnips.com/nsdoc/'. $file .'<script type="text/javascript"> document.write("/?id=" + new Date().getTime() + "")</script>';
The javascript is to generate "id". I want to include that variable in another function like
include($url);
and similar situations without it literally showing the javascript. If I run the include command for this I get:
http://www.esnips.com/nsdoc/XXXXXXXXX/<script type="text/javascript"> document.write("/?id=" + new Date().getTime() + "")</script>
But if I echo it I get:
http://www.esnips.com/nsdoc/XXXXXXXXX/?id=XXXXXXXX
(which is how it should be)
So is there any way I can ECHO the variable into an include situation or another variable without it taking the javascript literally?
Thanks so much in advance.