ini_get

(FW >= 1.0)

ini_get - get a value from an INI file

Description

mixed ini_get(string filename, string section, string key, mixed default_value)
Reads a configuration key from an ini file.  If the section or key are not found, the default value is returned.  Depending on the data type of the default value, the resultant data type will be set accordingly.

Parameters

$filename

full path and filename of ini file.

section

section inside ini file

key

key to load value for

default_value

default value to be returned in case the key is not found

Return Value

value associated with the key, or the default value in case it is not found

Examples

<? 

// get the network mask from the Wattmon network configuration file
$val = ini_get("/config/network.ini","network","netmask","255.255.255.0");
print($val);
?>