PHP generate Chinese code garbled Problem Resolution (_php) tutorial

Source: Internet
Author: User
PHP generates Chinese code garbled problem solving
The Chinese characters to be processed are then converted to HTML entities and then used by UTF8.

Example code:

//ini_set (' jis-mapped Japanese Font support ', false);
$pic =imagecreate (250,30);
$black =imagecolorallocate ($pic, 0,0,0);
$white =imagecolorallocate ($pic, 255,255,255);
$font = "C://windows//fonts//simhei.ttf";

$str = ' People's Republic of China ';
$str = mb_convert_encoding ($str, "html-entities", "utf-8");//Result: Which team is the first to tee off

Imagettftext ($pic, 10,0,10,20, $white, $font, $STR);

Header ("Content-type:image/jpeg");
$filename = './photo.jpg ';
$im =imagecreatefromjpeg ($filename);
Imagecopymerge ($im, $pic, 0,0,0,0,250,30,50);
Imagejpeg ($im);


Pchart Sample code:

/*
Example14:a Smooth Flat Pie graph
*/1 2

http://www.bkjia.com/PHPjc/632369.html www.bkjia.com true http://www.bkjia.com/PHPjc/632369.html techarticle PHP generated Chinese code garbled problem solving//will be processed by the Chinese characters, first by the UTF8 of Chinese characters into the HTML entity form again use.//Sample code://ini_set (' jis-mapped Japanese Font support ' ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.