\w in PHP preg_replace covers only second byte of UTF-8 chars

Posted by Andrey on Stack Overflow See other posts from Stack Overflow or by Andrey
Published on 2010-03-31T13:12:05Z Indexed on 2010/03/31 13:13 UTC
Read the original article Hit count: 212

Filed under:
|
|
|
|

we have this code:

$value = preg_replace("/[^\w]/", '', $value);

where $value is in utf-8. After this transformation first byte of multibyte characters is stripped. How to make \w cover UTF-8 chars completely?

Sorry, i am not very well in PHP

© Stack Overflow or respective owner

Related posts about php

Related posts about php5