Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Well this just makes me mad...
#1
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...
[Image: chaosthegreat.png]
Reply
#2
The difference is the type of quotes you're using.

" allows you to put values of variables in a string
' doesn't
Reply
#3
(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.
Reply
#4
I never knew that. Thanks.
[Image: chaosthegreat.png]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)