My ? is....why, when echoing html code via PHP, do people tend to use the html (\"). I understand why the escape character is used but if one just changes the html code to be echoed by using a single quote (') instead of ("), the escape character is not needed.
I have used the (') in place of the (") extensivley in my form processing, about 17 forms, and all works well. What if any problems will I run into?
The following depicts what I am trying to convey. The first if uses the single ' and no escape character. The 2nd if is how I typically see an html element echoed.
<li<?php if ($thisPage=="Page One")
echo " id='currentpage'"; ?>> <a href="#">Page One</a></li>
<li<?php if ($thisPage=="Page Two")
echo " id=\"currentpage\""; ?>> <a href="#">Page Two</a></li>