View Single Post
Old 01-08-2006, 06:32   #3 (permalink)
xml
Senior Member
 
Join Date: Sep 2004
Posts: 149
Skidzy McFergus,
Do you anticipate unicode characters in the string?

If so try this:
$cleanUnicodeStr = trim(preg_replace('#[^\p{L}\p{N}]+#u', ' ', $unicodeStr));

This will also clean up shitty unicode punctuation like those smily faces, musical quotations and stars etc, whilst at the same time allow for Japanese symbols and other such characters.
__________________
  Reply With Quote