Quotes Within Quotes Php
It s horrible for code readability and debugging and php is also slightly faster if single quotes are used like the first example of radu s answer.
Quotes within quotes php. It s recommended not to use double quotes with variables inside them. Double quotes and single quotes aren t exactly the same. Something oh something. In php it is different.
Single quoted double quoted heredoc syntax and since php 5 3 0 nowdoc syntax the first two of them being by far the most frequently used. Echo my answer is something br. My answer is oh something. It is important to know the difference between using single quotes and double quotes.
The original quotes within quotes post was intended to inform readers writers what the standard is. As in single quoted string s escaping any other character will result in the backslash being printed too. This is getting silly. In javascript you can use either single or double quotes and they behave the same.
Kingmaple may 9 12 at 8 39. There s nothing requiring the writer to deliberately manufacture a sentence with quotes within quotes within quotes. Before php 5 1 1 the backslash in var had not been printed. If the string is enclosed in double quotes php will interpret the following escape sequences for special characters.