php quotes

Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.


$str = 'string';

$str = "string {$value}";

$str = "SELECT * FROM table WHERE title = 'new'";

Leave a Comment