[nycphp-talk] stupid curly quotes
Chris Bielanski
Cbielanski at inta.org
Thu Mar 17 11:39:47 EST 2005
This deserves to be in a KB of some kind... I like that it'll even catch the
em-dash!
> -----Original Message-----
> From: Daniel Convissor [mailto:danielc at analysisandsolutions.com]
> Sent: Wednesday, March 16, 2005 7:06 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] stupid curly quotes
>
> On Wed, Mar 16, 2005 at 04:46:17PM -0500, Marc Antony Vose wrote:
> >
> > How do people here handle stripping crap like curly quotes
> out of text
> > that users are pasting from Microsoft Word?
>
> $search = array(
> '/[\x07\x95]/',
> '/\x85/',
> '/[\x91\x92]/',
> '/[\x93\x94]/',
> );
> $replace = array(
> '-',
> '...',
> '\'',
> '"',
> );
> $data = preg_replace($search, $replace, $data);
>
> --Dan
>
> --
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> data intensive web and database programming
> http://www.AnalysisAndSolutions.com/
> 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f:
> 718-854-0409 _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
More information about the talk
mailing list