Possible Duplicate:
PHP: different quotes?
Simple question:
What is the difference between ' and " in php? When should I use either?
asked Sep 9, 2009 at 22:54
johnnietheblackjohnnietheblack
12.8k27 gold badges91 silver badges132 bronze badges
5
Basically, single-quoted strings are plain text with virtually no special case whereas double-quoted strings
have variable interpolation [e.g. echo "Hello $username";
] as well as escaped sequences such as "\n" [newline.]
You can learn more about strings in PHP's manual.
answered Sep 9, 2009 at 22:57
There are 3 syntax used to declare strings, in PHP and -> may look similar but are totally different in their usage. => is referred to as double arrow operator. It is an assignment operator used in associative arrays to assign values to the key-value pairs when creating arrays.