Modifying the encoding in the server in PHP development

Source: Internet
Author: User
Modifying the encoding in the server in PHP development

1 Apache open Web page garbled, the method of modifying the Apache default character set is as follows:

Open Apache profile httpd.conf,windows under Apache configuration file path is generally D:\Program Files\apache software foundation\apache2.2\conf (default path installation)

Find adddefaultcharset utf-8, change it into adddefaultcharset GBK;

Then restart the Apache service.

2 PHP Development Sometimes cross-class calls, the preferred request "xxx.php";

header ("Content-type:text/html;charset=utf-8");   Set someone's character set require "user.php";  You must apply a class to use  //Request a request for a class $db =new User ();    Instantiate object $db->testone ();   Methods for calling Objects

The above describes the PHP development to modify the code in the server, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • 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.