I have one string in PHP script
$str="इन रिकॉर्ड्स पर है सलमान की नजर, धूम-3 को पछाड़ेगी जय हो?";
and converting it from below code:
$encoded_string = bin2hex(mb_convert_encoding($str, "UTF-16BE", 'UTF-8'));
Output at Mobile Device :
इन रिकॉ(Here Zero-Width Non-Joiner is displaying in output)र्ड्स पर है सलमान की नजर, धूम-3 को पछाड़ेगी जय हो?
but getting Zero-Width Non-Joiner ** in final output. how can i will remove this entity while converting string not after getting final output?
found Solution , Just replace Zero-Width Non-Joiner entity from String and it will works.
$str=str_replace('‌','',$str);
**OR**
$str=str_replace('‌','',$str;
$content = preg_replace( '/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $content );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With