What are some best practices for escaping quotes within PHP code to avoid syntax errors?

When including quotes within PHP code, it is important to escape them properly to avoid syntax errors. One common way to escape quotes is by using the backslash (\) character before the quote. This tells PHP to interpret the quote as a literal character rather than the beginning or end of a string. Example:

$myString = "This is a \"quoted\" string.";
echo $myString;