If you need to work with Russian text in PHP, you may notice that functions that are related to CaSe are not working as expected. I mean strtolower, strtouper, ucwords, and so on. In order to get what you need I suggest to use mb_convert functions. Here is the example:
You can check reference table for functions, I think you will find more useful functions for you.