$s='цкнгшщзхфвпрлджчсмтб'; $test=$s[rand(0,19)].$s[rand(0,19)]; echo $test; UTF-8 file without Bohm. In HTML it is signed that UTF-8 too. Derived Kracolzjabra.
$s='цкнгшщзхфвпрлджчсмтб'; $test=$s[rand(0,19)].$s[rand(0,19)]; echo $test; UTF-8 file without Bohm. In HTML it is signed that UTF-8 too. Derived Kracolzjabra.
<? $s='цкнгшщзхфвпрлджчasdб'; $test=mb_substr($s, rand(0,19), 1, 'utf-8').mb_substr($s, rand(0,19), 1, 'utf-8'); echo $test; ?> What did you want when choosing bytes from a string in UTF8?)
well then look
In UTF-8 encoding, 1 character takes 2 bytes and what you get is displayed correctly.
$s[rand(0,19)] This will output only part of the character. :) rewrite the code and read how UTF-8 differs from windows-1251
Source: https://ru.stackoverflow.com/questions/64347/
All Articles