![]() |
single quotes or double quotes in php
Hi
i am confused about which quotes to use. PHP Code:
which one you recommend? thanks |
Go with single quote better performance and when you have to echo out HTML you can keep your double quotes for your HTML.
PHP Code:
PHP Code:
PHP Code:
|
Though don't forget that any special character beginning with a back-slash: \b (backspace), \n (line break), \t (tab), etcetera, doesn't work as expected when encapsulated with single quotes. For that to work you must break out of your single quotes:
|
the amount of speed gained won't matter to much. Usually thats not the bottleneck. So it really comes down to which one you want to use and which one is easier in the specific case.
|
Actually, Cory has a point because most of the time I tend to use
sprintf for readability purposes. |
Thanks. no confusion now.
|
| All times are GMT. The time now is 07:31 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0