Possible Duplicate:
Difference between single quote and double quote string in php
I need to include some php code within some html file that I generate via PHP.
I have tried the following but this is not working. Can you explain to me why?
<?php
$text='mc';
echo '<text>"$text"</text>'
?>
Because you should use in this case
echo "<text>\"$text\"</text>"Read more about the different kinds of strings in PHP in this question and in the manual
You can also use String concatenation, like this:
echo '<text>' . $text . '</text>'Which way you prefer is totally up to you.