Single Quotes
The simplest way to specify a string is by using single quotes. All characters inside the pair of single quotes will be seen as text by PHP. That is, variables and special character combinations will not be parsed.
Sometimes we need to have the single quote character inside of a string. To do this when using single quotes, you need to escape that character by preceding it with the backslash. To include the character combination backslash, single quote, you’ll need to also escape the backslash with a backslash.
$text = 'This is my text.'; // This is my text. $text = 'This isn\'t your text.'; // This isn't your text. $text = 'Escape both: It wasn\\\'t me.'; // Escape both: It wasn\'t me. // variables and special characters aren't parsed $text = 'Total: $total'; // Total: $total $text = 'New \nLine'; // New \nLine
