This works:
<?php echo "\"" . $content . "\""; ?>
This doesn't 500 Internal Server Error:
"<?php echo $content; ?>"
Why? Thank you!
I'm using PHPStorm and MAMP.
This works:
<?php echo "\"" . $content . "\""; ?>
This doesn't 500 Internal Server Error:
"<?php echo $content; ?>"
Why? Thank you!
I'm using PHPStorm and MAMP.
Obviously the second will show you error. Because the second one is not even PHP code. It's simply a string. See carefully, the first one you told the server that it's a PHP code which started with <?php
and ended with ?>
.
But in the second code, you wrote <?php
tag inside the quotation. So server doesn't know that it has a PHP code inside. May be you got my point.