1
1
17aPaBo3uK2017-11-08 18:18:28
Character encoding
17aPaBo3uK, 2017-11-08 18:18:28

mb_strlen() function not showing correctly after json_decode()?

Hello everyone, help me solve the problem: after json_decode () I get an array, something like this:

$data = array(
    'titlt' => 'Проверка', 
    'content' => 'текст'
);

When I check mb_strlen($data['title']) I get 81
mb_detect_encoding($data['title']) = UTF-8
mb_internal_encoding('UTF-8'); - Does not help.
I need to compare $data['title'], but this code returns false
if ($data['title'] == 'Проверка') {
    echo 'true';
} else {
    echo 'false';
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question