Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make cyrillic chars upper case?

Tags:

php

So how do I get cyrillic chars to upper case?

echo strtoupper("русские");

this doesn't work.

like image 588
bukowski Avatar asked Apr 04 '12 13:04

bukowski


2 Answers

Use mb_strtoupper with correct encoding (without it it won't work):

echo mb_strtoupper("русские", "utf-8");
РУССКИЕ
like image 84
vartec Avatar answered Nov 08 '22 14:11

vartec


You will have to use MultiByte functions:

mb_strtoupper

Make sure that MB is installed and enabled in your PHP ;)

like image 3
Jovan Perovic Avatar answered Nov 08 '22 12:11

Jovan Perovic