User Tools

Site Tools


uphp:functions:ini_get

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

uphp:functions:ini_get [2017/04/13 07:27]
jeff
uphp:functions:ini_get [2021/09/13 05:57]
Line 1: Line 1:
-======ini_get====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Get a value from an INI file 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%;color:green">mixed 
-<span style="color:black"> 
-</html> 
-[[ini_get]] ( 
-<html> 
-<span style="color:green">string 
-<span style="color:blue">$filename<span style="color:black">, 
-<span style="color:green">string 
-<span style="color:blue">$section<span style="color:black">, 
-<span style="color:green">string 
-<span style="color:blue">$key<span style="color:black">, 
-<span style="color:green">mixed 
-<span style="color:blue">$default 
-<span style="color:black">) 
-</html> 
-</well> 
- 
-<html>This function reads a configuration <b><span style="color:blue">key<span style="color:black"></b> value from an INI file. If the <b><span style="color:blue">section<span style="color:black"></b> and <b><span style="color:blue">key<span style="color:black"></b> are not found, the <b><span style="color:blue">default<span style="color:black"></b> value is returned.</html> 
- 
-====Parameters==== 
- 
-<html><b><span style="color:blue">$filename<span style="color:black"></b></html>:  Full path and name of the INI file 
- 
-<html><b><span style="color:blue">$section<span style="color:black"></b></html>:  Section inside the INI file 
- 
-<html><b><span style="color:blue">$key<span style="color:black"></b>:  Key name inside the <b><span style="color:blue">section<span style="color:black"></b></html> 
- 
-<html><b><span style="color:blue">$default<span style="color:black"></b>:  Value to be returned if the <b><span style="color:blue">section<span style="color:black"></b> and <b><span style="color:blue">key<span style="color:black"></b> are not found</html> 
- 
-====Return Value==== 
- 
-<html><b><span style="color:green">Mixed<span style="color:black"></b>:  Value associated with the <b><span style="color:blue">key<span style="color:black"></b>, or the <b><span style="color:blue">default<span style="color:black"></b> value if the <b><span style="color:blue">section<span style="color:black"></b> and <b><span style="color:blue">key<span style="color:black"></b> are not found</html> 
- 
-<html>The value will be of type <b><span style="color:green">string<span style="color:black"></b>, <b><span style="color:green">integer<span style="color:black"></b> or <b><span style="color:green">float<span style="color:black"></b> depending on the data type of the <b><span style="color:blue">default<span style="color:black"></b> value.</html> 
- 
-====Example==== 
- 
-===Get the network mask from the Wattmon network configuration file=== 
- 
-<code php> 
-<? 
-  $val=ini_get("/config/network.ini","network","netmask","255.255.255.0"); 
-  print($val); 
-?> 
-</code> 
- 
-====See Also==== 
- 
-[[ini_get_array()]] - Get a group of parameters from an INI file as an <html><b><span style="color:green">array<span style="color:black"></b></html> 
- 
-[[ini_put_array()]] - Write the values from a key/value <html><b><span style="color:green">array<span style="color:black"></b></html> to an INI file, with optional section 
- 
-[[ini_set()]] - Write a value to a section in an INI file 
  
uphp/functions/ini_get.txt · Last modified: 2021/09/13 05:57 (external edit)