Home php First Line Letter in Lower Register (Cyrillic)

First Line Letter in Lower Register (Cyrillic)

Author

Date

Category

Tell me, please, how to translate the first letter of the string to the lower case in Cyrillic?


Answer 1, Authority 100%

Separate the first character from the rest of the text and give to the bottom register, then attach it back.

$ value = 'Born on the street Herzen, in the grocery number twenty two.';
$ Value. = 'Famous economist, by calling your own - librarian.';
$ firstchar = mb_substr ($ value, 0, 1);
$ firstchar = MB_STRTOLOWER ($ firstchar);
$ otherchars = MB_Substr (
  $ value
  1,
  MB_STRLEN ($ Value)
);
$ Value = $ Firstchar. $ Otherchars;

more stylish option in the form of a function, use on health.

Function FirstchartolowerCase (String $ Value): String
{
  $ firstchar = mb_substr ($ value, 0, 1);
  $ firstchar = MB_STRTOLOWER ($ firstchar);
  $ otherchars = MB_Substr (
    $ value
    1,
    MB_STRLEN ($ Value)
  );
  Return $ Firstchar. $ Otherchars;
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions