Single-quoted strings in PHP are literal strings, meaning that all characters in the string are taken as is. This means that special characters like newline, tab, or backslash are not interpreted. For example:
$str = ‘This is a single-quoted stringn’;
The output of the above code would be:
This is a single-quoted stringn
Double-quoted strings in PHP are interpreted strings, meaning that special characters like newline, tab, or backslash are interpreted. For example:
$str = “This is a double-quoted stringn”;
The output of the above code would be:
This is a double-quoted string
(newline character is interpreted)