Usage of ini_set and ini_get functions in PHP _ PHP Tutorial

Source: Internet
Author: User
Tags configuration php
Summary of ini_set and ini_get functions in PHP. The ini_set function in php is provided by php to modify and set php. ini configuration file function, this function is very convenient, you do not need to manually modify php. sometimes we do not have the permission to modify the ini_set function in php. ini configuration file function, this function is very convenient, you do not need to manually modify php. INI files, sometimes we do not have the permission to modify php. ini file, then this function is used.

Syntax:Ini_set ("option", "value"); it is best to put this function in the header of the php script.

For example: ini_set ("max_execution_time", "180"); // Set the php script timeout to 180 seconds.

For specific php options, refer to the Configuration PHP Core section of the phpinfo file.

Ini_get is the opposite of ini_set. it is used to obtain the value of the environment variable in the php. ini file.

Syntax:String ini_get (string varname); return the value of the option. if the option value is Boolean, the return value is 0 or 1.

For example, echo ini_get ('max _ execution_time '); // output 30

If you want to get the variable value in the entire php. ini, you can use the ini_get enhancement function ini_get_all () to return the entire php environment variable in the form of an array.

...

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.