Quote:
|
Originally Posted by worldbringer
First of all, if you're defining a php variable, you need a dollar sign:
$ROTFLMAO = "Rolling On The Floor Laughing Out Loud";
|
Although that's acceptable code, it's inefficient. The quotations cause PHP to check the string for the presence of variables, where as with apostrophes PHP just outputs the text directly. That is why
Code:
$bad = '(Butt)';
$ROTFLMAO = 'Rolling On The Floor Laughing My $bad Off';
echo $ROTFLMAO;
Will show
Rolling On The Floor Laughing My $bad Off
You could however, do
Code:
$bad = '(Butt)';
$ROTFLMAO = 'Rolling On The Floor Laughing My '.$bad.' Off';
Which would show Rolling On The Floor Laughing My (Butt) Off
Where
Code:
$bad = '(Butt)';
$ROTFLMAO = "Rolling On The Floor Laughing My $bad Off";
echo $ROTFLMAO;
Will show Rolling On The Floor Laughing My (Butt) Off
My bad if I steered us horribly off topic 