


JpGraph4.0.2 Chinese garbled characters and solutions that cannot be displayed in php7.0 version
1.php7.0 version cannot display . Methods with the same name as their class will not be constructors in a future version of PHP:
JpGraph4.0.2 cannot display graphical reports correctly in PHP7.0 version.
The following error was obtained through php log:
Before modification:
will change the function LinePlot Changed to function __construct
After modification:
Reason: Before
php7.0, the method with the same name as the class can be regarded as a constructor method.
After php7.0, the constructor with the same name as the class will no longer be supported, and the constructor method will uniformly use __construct().
2. The Chinese title is garbled
Cause:
The default in JpGraph is to convert the string into utf8, but if your file It is utf8 itself and uses Chinese fonts. It will be converted once. As a result, if it is converted one more time, garbled characters will appear.
Solution:
Use the following encoding to convert all places where Chinese is used.
$graph->title->Set(iconv("UTF-8","GB2312//IGNORE","网志博客信息统计表")); $graph->xaxis->title->Set(iconv("UTF-8","GB2312//IGNORE","X-标题")); $graph->yaxis->title->Set(iconv("UTF-8","GB2312//IGNORE","Y-标题"));
Note:
Use the PHP function to convert Chinese data from UTF-8 to GB2312. Remember that due to a bug in iconv itself, iconv will make an error when converting the character "—" to gb2312. , so add "//IGNORE" after the encoding to be converted.
Recommended: "PHP7"
The above is the detailed content of JpGraph4.0.2 Chinese garbled characters and solutions that cannot be displayed in php7.0 version. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software