Approach One
SELECT * FROM V$nls_parameters
$conn = Oci_connect (' Scott ', ' Donkey ', ' demo ', ' ZHS16GBK ');
while ($dat = Oci_fetch_row ($cur)) {
Print_r (Iconv (' gb2312 ', ' utf-8 ', $dat [0])); $nickname = mb_convert_encoding ($dat [0], ' utf-8 ', ' GBK ');
}
or $c 1 = oci_connect ("Scott", "Tiger", $db, ' UTF8 ');
Option two:
After installing the server, look at the server language with the client
Sql>select * from V$nls_parameters Where parameter= ' nls_language ';
Like the result is "Simplified Chinese."
Add environment variables to Apache
Export nls_language= "Simplified Chinese"
Add in/etc/init.d/httpd, source code to install Apache write a script call Apachectl
Or you need to introduce the environment variable in/ETC/INIT.D/HTTPD, because the machine does not have the boot file, so you can only add the following code in APACHECTL:
Export nls_language= "Simplified Chinese".
Method Three: httpd.conf riga one row adddefaultcharset Gb2312/off
Method four: Htmlspecialchars () supports double-byte characters, such as Chinese characters
Htmlentities () supports Single-byte characters
Method Five: Apache configuration file has been added Adddefaultcharset GB2312
PHP's configuration file has been added Adddefaultcharset GB2312