You should not use preg_replace for this, because preg_replace is used to match a specific pattern and replaces it with something else. The wat you want is to replace each uppercase character with lowercase, so there is no need to match the pattern.
mb_strtolower is the way to go, and if you don't have mb_ functions, you will need to write the function yourself using a lot of str_replace ...
source share