Hacker News new | ask | show | jobs
by syberspace 1673 days ago
I've gotten into the habit of generally using single quoted strings (with 'around them') which alleviates most problems with escaping double quotes. And for the odd string that needs to have a single quote inside I switch back to double quoting.

This approach also has the added bonus of stopping PHP from accidentally evaluating something inside the strings.