Objects •
are called HTML entities. PHP has a function that can create them: mb_encode_numericentity
Docs , this is part of the Multibyte String Extension ( Demo ):
$string = 'рдореЗрд░рд╛ рднрд╛рд░рдд рдорд╣рд╛рди'; $encoding = 'UTF-8'; $convmap = array(0, 0xffff, 0, 0xffff); $encoded = mb_encode_numericentity($string, $convmap, $encoding); echo $encoded; &
However: you need to know the encoding of your string. In this case, I chose UTF-8
, depending on this you need to change the $encoding
parameter of the function and the $convmap
.
However, do not store it this way in your database. Keep it as it is and convert the output encoding after , you have extracted data from your database. / P>
Similar question: Convert (doublebyte) string to hexadecimal
hakre source share