2DWorlds Forums
Well this just makes me mad... - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: Off Topic (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=5)
+--- Forum: Programming (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=30)
+--- Thread: Well this just makes me mad... (/showthread.php?tid=7624)



Well this just makes me mad... - Chaos - 08-03-2011

I was writing some code and I found something funny. (example)

[lua]
<?php
echo '$variable';
?>
[/lua]

Doesn't work. It works for printing words, but not variables. I didn't know why.

But here's the strange thing that made me mad.

After about a half an hour trying to figure out what's wrong I just started messing around.

It turns out THIS works...

[lua]
<?php
echo("$post");
?>
[/lua]

Wow...THEY ARE THE SAME THING...


RE: Well this just makes me mad... - noob007 - 08-03-2011

The difference is the type of quotes you're using.

" allows you to put values of variables in a string
' doesn't


RE: Well this just makes me mad... - Cap - 08-03-2011

(08-03-2011, 09:05 AM)noob007 Wrote: The difference is the type of quotes you're using.

" allows you to put values of variables in a string
' doesn't

Noob just won 3 interwebz.



RE: Well this just makes me mad... - Chaos - 08-03-2011

I never knew that. Thanks.