Why can not I convert the variable to lower case
list($name, $firstname) = explode(" ", $_POST["name_firstname"]); $a = strtolower($name);
Why can not I convert the variable to lower case
list($name, $firstname) = explode(" ", $_POST["name_firstname"]); $a = strtolower($name);
The string encoding does not match the current PHP system encoding.
You can change the encoding of the string or PHP, you can use mb_strtolower
indicating the specific encoding.
Try this option:
list($name, $firstname) = explode(" ", $_POST["name_firstname"]); echo mb_strtolower($name, 'UTF-8');
The strtolower()
function converts only the Latin alphabet. Cyrillic function ignores. Perhaps this is the case.
In principle, the answers are correct, I will add a clarification.
1) Specify explicitly somewhere in the configuration file that UTF-8 encoding is used for mb_
functions, the default is different.
mb_internal_encoding("UTF-8");
In lower case, you can lead the function mb_strtolower()
Source: https://ru.stackoverflow.com/questions/200983/
All Articles