PDA

View Full Version : Would you initialize your strings with single quotes or double quotes?



Jackey
11-03-2010, 12:05 PM
- Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
--
hotels in goa (http://transglobalholidays.com/)
resorts in goa (http://transglobalholidays.com/)

ms123
11-11-2010, 09:01 AM
Both are good but I would prefer & recommend that we go for initializing string with single quotes which would help in speeding process

Hewitt
02-24-2011, 11:28 AM
Single quote strings are executed faster than double quotes
When we use single quote for string then php will not parse the things between that quote. It simply assign as it is.
But when we use double quotes then it will parse for variables and other things between double quotes.

Nyla432
04-07-2011, 01:53 PM
If the string is enclosed in double-quotes PHP understands more escape sequences for special characters. Escape sequences for special characters will not be expanded when they occur in single quoted strings.