R
R
Rinat2014-04-13 12:24:03
PHP
Rinat, 2014-04-13 12:24:03

Printing Variables in Single Quotes

Rhetorical question: Is it possible to output a variable in any way, through single quotes echo ?
something like this: echo'<html> class="$nav" </html>'
options: shielding please do not offer, i.e.
echo "<html> class=\" $nav \"</html>"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Obrezkov, 2014-04-13
@WaRstim

And why is concatenation or double quotes not suitable?

echo "<html>$nav</html>";
echo '<html>' . $nav . '</html>';

They seem to be concatenated with a dot, otherwise I don’t remember)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question