NYCPHP Meetup

NYPHP.org

[nycphp-talk] Bug in PHundamentals function?

Chris Shiflett shiflett at php.net
Mon Oct 3 19:27:03 EDT 2005


Aaron Fischer wrote:
 > $sb_string = "I\'\'m heading out on the road";

You don't have to escape single quotes when you enclose the string with 
double quotes. I wrote a bit more on quoting strings here:

http://shiflett.org/archive/140

Dan Cech wrote:
 > return $sybase ? str_replace ("''", "'", $var) : stripslashes ($var);

I prefer this approach when it helps me avoid escaping. In this case, I 
think both look confusing, but the escaping makes it worse.

Chris

-- 
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/



More information about the talk mailing list