PDA

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



Jackey
11-03-2010, 11:05 AM
- 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, 08: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, 10: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, 12: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.