I have a strings like
$string1 = 'love is all mine 🔥';
$string2 = '🔥Sarah is good girl⭐';
$string3 = 'हिन्दी ya ⭐';
$string4 = 'hái 还/還 ("still"), yǐjīng 已经 ';
i want to encode them in a harmless encoded strings like
Api Hatal\u0131d\u0131r. L\u00fctfen kontrol ederek tekrar deneyiniz
in which no special charactor and utf8 character so that i can use it in javascript. I have tried utf8_encode() and mb_convert_encoding( $string4 , 'UTF-8', 'UCS-2BE');. utf8_encode() is simply not working as it is giving error in javasciprt (because i want to create json response and to use it in my code). and mb_convert_encoding( $string4 , 'UTF-8', 'UCS-2BE'); is converting whole string into other Chinese characters.