NYCPHP Meetup

NYPHP.org

[nycphp-talk] stupid curly quotes

Wai Siow rs234 at cornell.edu
Wed Mar 16 17:15:01 EST 2005


preg_replace would be the best i think... then u can just use a regexp like

[^a-zA-Z0-9\-\s\.\,]* to replace all the non-alpha numerical (excluding a
few exceptions like punctuations) with anything u want...

note: the regexp is just an example... so there might be typos and
stuff... read the doc on regexp to create one that will suit your needs

- Ray

> Hi there.
>
>
> I should have clarified that I mean situations where the end-user is
> not under your control; specifically, when text is pasted from Word
> into an HTML form.
>
>
>>This is an old problem that I am again searching for the prefect solution
>> to.
>>
>>How do people here handle stripping crap like curly quotes out of
>>text that users are pasting from Microsoft Word?
>>
>>Any pointers or advice are welcome...:)
>
>
> Cheers,
> --
> Marc Antony Vose
> http://www.suzerain.com/
>
> Never underestimate the power of human stupidity.
> -- Lazarus Long
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>


Wai (Raymond) Siow
Web Application Developer / Programmer
Web Development Team
Cornell Cooperative Extension
Email: r s two three four at cornell dot edu
Phone: (six-o-seven) two-five-five-seven-nine-four-nine




More information about the talk mailing list