In this example you can see that we don't need to add escape characters for each Double Quote we want to echo as HTML.
This, by its self is a good enough reason to migrate, however, a 2nd reason is performance.
Using Single Quotes is always at least as fast as Double Quotes and in some cases faster by hundreds of percents.
I prefer single quotes because its only one keystroke instead of two. That is, I don't have to mash the shift key to make single quote.
Personally I stick with one or the other. It doesn't matter.
Both would work but one may ask, so what is the big deal? why is it better?
Double Quotes way :
<?php
<?
Echo "<TABLE BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"0\">";
?>
Single Quotes way :
<?php
<?
Echo '<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0">';
?>
In this example you can see that we don't need to add escape characters for each Double Quote we want to echo as HTML.
This, by its self is a good enough reason to migrate, however, a 2nd reason is performance.
Using Single Quotes is always at least as fast as Double Quotes and in some cases faster by hundreds of percents.
I prefer single quotes because its only one keystroke instead of two. That is, I don't have to mash the shift key to make single quote.