Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $enc = 'UTF-8';
- $word = "РАЗРАБОТАТЬ";
- $word = preg_replace('/s+/', '', $word);
- $word = mb_convert_case($word, MB_CASE_TITLE, "UTF-8");
- $count = mb_strlen($word, $enc);
- $new_word = mb_substr($word, 0, ($count - 1), $enc);
- $new_word = $new_word . mb_strtoupper(mb_substr($word,($count - 1), 1, $enc), $enc);
- $randomLine = $new_word;
- header('Content-Type: text/html; charset=utf-8');
- AddDefaultCharset UTF-8
- function mb_strrev($str){
- $r = '';
- for ($i = mb_strlen($str); $i>=0; $i--) {
- $r .= mb_substr($str, $i, 1);
- }
- return $r;
- }
- function mb_ucfirst($str) {
- $fc = mb_strtoupper(mb_substr($str, 0, 1));
- return $fc.mb_substr($str, 1);
- }
- $word = "РАЗРАБОТАТЬ";
- $result = mb_strrev(mb_ucfirst(mb_strrev(mb_ucfirst(mb_strtolower($word))))); // РазработатЬ
- $word = "РАЗРАБОТАТЬ";
- $word = preg_replace('/s+/', '', $word);
- $word = mb_strtolower($word);
- $word[1] = mb_strtoupper($word[1]);
- $word[mb_strlen($word)-1] = mb_strtoupper($word[mb_strlen($word)-1]);
Add Comment
Please, Sign In to add comment