PHP require and include reference URLs and PHP file encoding conversion function Problems _php Tutorial

Source: Internet
Author: User
This article at the same time solve two problems is PHP require and include reference URL and PHP file encoding conversion function problem, the need for friends can see Ha, refer to.

PHP Configuration "allow_url_fopen" This option is open, you can use the URL as an include or require parameters.
As well as Allow_url related parameters, refer to php.ini for details.

Converting an entire page

This method applies to all coding environments. In this way, the character set of the first 128 characters (display character) is used in NCR (Numeric character reference, such as "kanji" will be converted to "Chinese characters" this form), so that the code in any encoding environment, the page can display normally.

Another question:
This method applies to all coding environments. In this way, the character set of the first 128 characters (display character) is used in NCR (Numeric character reference, such as "kanji" will be converted to "Chinese characters" this form), so that the code in any encoding environment, the page can display normally.


Add the following three lines of code to the header of the PHP file:

The code is as follows Copy Code
Mb_internal_encoding ("gb2312"); The gb2312 here is the original code of your website.
Mb_http_output ("Html-entities");
Ob_start (' Mb_output_handler ');

Use the Mb_convert_encoding function to enable the PHP mbstring (multi-byte string) extension.

If there is no mbstring extension for PHP, you need to do the following

http://www.bkjia.com/PHPjc/632249.html www.bkjia.com true http://www.bkjia.com/PHPjc/632249.html techarticle This article at the same time solve two problems is PHP require and include reference URL and PHP file encoding conversion function problem, the need for friends can see Ha, refer to. PHP configuration in the Al ...

  • Related Article

    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.