How to use Chinese language with imagettftext() in php -
i using imagettftext() write text on images , it's working english language when use chinese language getting ???? on image.
i got code here it's not working me
//$text = "你好"; $fname = $_post['fname']; // convert utf-8 string html entities $text = mb_convert_encoding($fname, 'html-entities', "utf-8"); // convert html entities iso-8859-1 $text = html_entity_decode($text, ent_noquotes, "iso-8859-1"); // convert characters > 127 hexidecimal equivalents $out = ""; for($i = 0; $i < strlen($text); $i++) { $letter = $text[$i]; $num = ord($letter); if($num>127) { $out .= "&#$num;"; } else { $out .= $letter; } }
can please me missing on there?
Comments
Post a Comment