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

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -