Sometimes it's necessary.
And yeah .PJ, you can use \" or ', just never " on it's own. It's not even needed to use quotes at all in most situations, only when there are gaps in the " and " content and I think when validating. I found this all out the hard way too.
When I first started coding/programming with php I went nuts for ages over a simple script that was returning a php error because I was echoing the code and using quotation marks. I guess in the end,you learn by making mistakes. (I'm amazed this simple topic has drawn so much commenting here

)