What your code would do is to store a string starting with ?>
and ending with <?php
in the variable $content
. That's probably not what you want to do? If you later echo such a string, you would most probably get errors due to these php tags.
As mentioned in other answers, heredoc would be a solution but in general you should try to avoid such situations where you have to store very long html sequences in a variable. Rather use a view file and inject some dynamic content there or use some sort of include.
So, depending on what you really want to do,your options are:
- heredoc
$content = "<html>markup here</html>";
- via output buffering
- using a view (look for info about the MVC pattern, you can also just do VC for a start)
- using includes