How to replace all non-alphabetic characters with UTF-8 support in PHP

Viewed 6859

I want to remove all non-alphabetic character from a string. The problem is that I don't know the letter range because it is UTF8 string.

It can be ENGLISH, ՀԱՅԵՐԵՆ, ქართული, УКРАЇНСЬКИЙ, РУССКИЙ

I usually do something like this:

$str = preg_replace('/[^a-zA-Z]/', '', $str);

or

$str = preg_replace('/[^\w]/u', '', $str);

but they both clear foreign characters.

Any ideas?

3 Answers
Related