User Tools

Site Tools


uphp:functions:ini_set

Differences

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

Link to this comparison view

uphp:functions:ini_set [2019/06/12 05:42]
admin
uphp:functions:ini_set [2021/09/13 05:57]
Line 1: Line 1:
-======ini_set====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Set a value in an INI file 
- 
-====Description==== 
- 
-<well size="sm"><html> 
-<span style="font-size:125%;color:green">int 
-<span style="color:black">ini_set ( 
-<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">$value 
-<span style="color:black">) 
-</html></well> 
- 
-This function writes a configuration key/value pair to an INI file. 
- 
-<html>If the INI file does not already exist it is created with the given <b><span style="color:blue">section<span style="color:black"></b>, <b><span style="color:blue">key<span style="color:black"></b> and <b><span style="color:blue">value<span style="color:black"></b>. However, if the INI file already exists it is updated only for the specified <b><span style="color:blue">section<span style="color:black"></b>, <b><span style="color:blue">key<span style="color:black"></b> and <b><span style="color:blue">value<span style="color:black"></b>, which preserves any other information, sections, keys or values that might be in the file to begin with.</html> 
- 
-<html>If the <b><span style="color:blue">section<span style="color:black"></b> does not exist it is appended to the end of the file along with the <b><span style="color:blue">key<span style="color:black"></b> and <b><span style="color:blue">value<span style="color:black"></b>.</html> 
- 
-<html>If the <b><span style="color:blue">key<span style="color:black"></b> does not exist it is added to the <b><span style="color:blue">section<span style="color:black"></b>, if it exists, otherwise the <b><span style="color:blue">section<span style="color:black"></b>, <b><span style="color:blue">key<span style="color:black"></b> and <b><span style="color:blue">value<span style="color:black"></b> are appended to the end of the file.</html> 
- 
-=== Clearing a Key === 
- 
-By specifying a blank ('') value for the key, the key and value will be erased from the ini file. 
- 
-====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>:  Name of the section inside the INI file 
- 
-<html><b><span style="color:blue">$key<span style="color:black"></b>:  Name of the key inside the <b><span style="color:blue">section<span style="color:black"></b></html> 
- 
-<html><b><span style="color:blue">$value<span style="color:black"></b>:  The value to write (<b><span style="color:green">string<span style="color:black"></b>, <b><span style="color:green">int<span style="color:black"></b> or <b><span style="color:green">float<span style="color:black"></b>)</html> 
- 
-====Return Values==== 
- 
-<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 on success or 0 on failure 
- 
-====Example==== 
- 
-<code php> 
-<? 
-  $fn="/ini_set_example.ini"; 
-  ini_set($fn,"network","address1","90.0.0.1"); 
-  ini_set($fn,"general","enabled",1); 
-  ini_set($fn,"general","connected",0); 
-  /* ... get connected ... */ 
-  ini_set($fn,"general","connected",1); 
-?> 
-</code> 
- 
-The INI file will contain: 
- 
-<code> 
-[network] 
-address1=90.0.0.1 
-[general] 
-enabled=1 
-connected=1 
-</code> 
- 
-====See Also==== 
- 
-[[ini_get()]] - Get a value from an INI file 
- 
-[[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 a group of parameters to an INI file from an <html><b><span style="color:green">array<span style="color:black"></b></html> 
  
uphp/functions/ini_set.txt · Last modified: 2021/09/13 05:57 (external edit)