0

This works:

<?php echo "\"" . $content . "\""; ?>

This doesn't 500 Internal Server Error:

"<?php echo $content; ?>"

Why? Thank you!

I'm using PHPStorm and MAMP.

Hillcow
  • 890
  • 3
  • 19
  • 48

1 Answers1

-1

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.

Shaharia Azam
  • 1,948
  • 19
  • 25