I received the content from my database using:
$strip_title = html_entity_decode(strip_tags($title),ENT_QUOTES,'UTF-8');
it’s displayed correctly with this string after echo
:
[MV HD] Nợ Ai Äó Cả Thế Giá»i â Phạm Quỳnh Anh
but when I display above string as an array of characters using str_split
function:
$result = str_split($title);
echo "<pre>";
print_r($result);
echo "</pre>";
then the result look something like this:
Array
(
[0] => [
[1] => M
[2] => V
[3] =>
[4] => H
[5] => D
[6] => ]
[7] =>
[8] => N
[9] => �
[10] => �
[11] => �
......................
What am I doing wrong here? How to correct this problem?
You can take a look at this sandbox demo
Sandbox Demo.