Skip to Main Content
PHP in a Nutshell
book

PHP in a Nutshell

by Paul Hudson
October 2005
Intermediate to advanced content levelIntermediate to advanced
372 pages
11h 35m
English
O'Reilly Media, Inc.
Content preview from PHP in a Nutshell

Name

ini_set()

Synopsis

    string ini_set ( string varname, string value )

The ini_set() function allows you to change system attributes that affect the way your script is executed. Changes only affect the current script, and will revert back when the script ends.

To use ini_set(), pass it the value you want to change as its first parameter, and the new value to use as its second parameter. If it is successful, it will return the previous value. For example:

    print ini_set("max_execution_time", "300") . "<br />";
    print ini_set("display_errors", "0") . "<br />";
    print ini_set("include_path", "/home/paul/include") . "<br />";

Many variables cannot be changed using ini_set(), because they have already been used. For example, magic_quotes_gpc decides whether PHP should automatically send all HTTP input through the addslashes() function before giving it to you. Although you can change this using ini_set(), it is pointless to do so: it will be changed after PHP has already modified the variables.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP Cookbook

PHP Cookbook

Eric A. Mann
Programming PHP

Programming PHP

Rasmus Lerdorf, Kevin Tatroe
Learning PHP

Learning PHP

David Sklar

Publisher Resources

ISBN: 0596100671Errata Page