Friday 13 October 2017

php - Question mark( �) displaying instead of each Bengali unicode character. How to fix it?

The problem is confusing,such
as,


When I am trying to display a Bengali unicode
word,'কলম' with this



$data=$_POST['data'];
echo
$data;

Then it displays the word
'কলম' properly as I
wanted,


But when I split the word character by character
with this


 for($i=0;$i<3;$i++)

{
echo $data[$i];
echo "+";

}

Then it display
'�+�+�+' instead of displaying like this
'ক+ল+ম+'.


How to solve this problem .Thank you.


For information , I have declared charset utf-8 in
head.



<
meta http-equiv= " Content-Type " content= " text/html;
charset=utf-8 "
/>


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...