Examples
This is a single quotes example: Example of a string with single quotes.
This is a double quotes example: Example of a string with double quotes.
In PHP, There are major differences between using single and double quotes with strings:
- Single quotes: Variables are not parsed inside single quotes. Escape sequences (\n, \r, \t, etc.) and backslashes (\) are treated as literal characters.
- Double quotes: Variables are parsed inside double quotes. The escape sequences and backslashes are interpreted accordingly. You cab also embed variables directly within the string of a double quote.