Convert Russian characters from uppercase to lowercase in php

I am trying to change the case of Russian characters from upper to lower.

function toLower($string) { echo strtr($string,'',''); }; 

This is the function I used, and the output looks something like this:

HEY ## yo ## `

Can someone help me? thanks in advance

+4
source share
2 answers
 $result = mb_strtolower($orig, 'UTF-8'); 

(assuming data is in utf-8)

+8
source

Specify the encoding in HTML and use mb_strtolower() to convert case:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> <html> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <head> <title></title> </head> <body> <? $string = '' ; echo mb_strtolower($string, 'UTF-8'); ?> </body> </html> 

In the meta tag, it looks like this:

  

Without a meta tag, it looks like

 цукенгшщзхъфывапролджÑÑчÑмитьбю 
+3
source

All Articles