Visit the Official PHP Website
PHP Programming - Lesson 1d
By James N Hitz
Yes... Now What?!
Let's fix the problem. Try this:
<html><head><title>Hello PHP World</title></head> <body> <?php print("<h2>Hello PHP World</h2>"); echo("<hr>"); print("<p><font size=\"3\" color=\"red\">PHP seems like fun</font></p>"); ?> </body></html>
There! Solved. All quotes WITHIN a string of text MUST be escaped. In plain English, this means that they will require to be acknowledged as quotes within quotes. This is done by preceeding them with a fore-slash: (\").
Other escapes for popular "forbidden characters" are:
"Thank you very much Sir. BUT, do I have to escape all the text all the time? Come On. How much time of escaping do you think that will cost me...."
Enough! Escaping can be a bore. That is a fact. Especially if you have a lot of text to output. Just imagine how much escaping you will do if you wanted to produce an electronic newsletter (e-newsletter). Not a pretty site either. So?!
Enter the Here document.