February 2008
Intermediate to advanced
216 pages
4h 33m
English
Sometimes phpinfo() can be overkill if you know what you're looking for. For example, you may just want to find out whether magic quotes is turned on or check an include path. Furthermore, phpinfo() won't help you if you're writing a script that behaves one way if a setting is enabled and another way if it's not.
To get the value of a particular configuration setting, use the ini_get() function as follows:
<?php
echo "The register_globals value is " . ini_get('register_globals');
?>Give ini_get() a valid configuration parameter name, and it returns the current setting on the current server. The setting is returned as a regular value, so you can print it, assign it to a variable, and so on. However, there are two ...
Read now
Unlock full access