php - Can I echo a variable with single quotes? -



php - Can I echo a variable with single quotes? -

can echo in single quotes variable?

example

echo 'i love $variable.';

i need because have lots of html echo too.

you must either use:

echo 'i love ' . $variable . '.';

this method appends variable string.

or use:

echo "i love $variable.";

notice double quotes used here!

php echo

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -