User Tools

Site Tools


uphp:functions:ini_put_array

Differences

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

Link to this comparison view

uphp:functions:ini_put_array [2017/05/08 14:28]
jeff
uphp:functions:ini_put_array [2021/09/13 05:57]
Line 1: Line 1:
-======ini_put_array====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Write a group of parameters to an INI file from an <html><b><span style="color:green">array<span style="color:black"></b></html> 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%"> 
-<span style="color:black">ini_put_array ( 
-<span style="color:green">string 
-<span style="color:blue">$filename<span style="color:black">, 
-<span style="color:green">array 
-<span style="color:blue">$data 
-<span style="color:black">[, 
-<span style="color:green">string 
-<span style="color:blue">$section 
-<span style="color:black">] ) 
-</html> 
-</well> 
- 
-<html>This function writes multiple configuration key/value pairs to an INI file. Values can be written to a single section if the optional <b><span style="color:blue">section<span style="color:black"></b> is specified (provide a single-dimensional <b><span style="color:green">array<span style="color:black"></b>). Values can be written to one or more sections if <b><span style="color:blue">section<span style="color:black"></b> is not specified (provide a two-dimensional <b><span style="color:green">array<span style="color:black"></b>).</html> 
- 
-<alert type="warning">If the INI file already exists it will be entirely overwritten. Use [[ini_set]] to partially update an existing INI file.</alert> 
- 
-====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">$data<span style="color:black"></b>:  <b><span style="color:green">Array<span style="color:black"></b> of key/value elements to write</html> 
- 
-  * <html>If <b><span style="color:blue">section<span style="color:black"></b> is specified, a single-dimensional <b><span style="color:green">array<span style="color:black"></b> should be provided (to write values only to one section).</html> 
-  * <html>If <b><span style="color:blue">section<span style="color:black"></b> is not specified, a two-dimensional <b><span style="color:green">array<span style="color:black"></b> can be provided, where the first dimension contains the sections and the second the key/value pairs (to write values in one or more sections).</html> 
- 
-<html><b><span style="color:blue">$section<span style="color:black"></b>:  Optional, name of the section inside the INI file (provide the <b><span style="color:blue">data<span style="color:black"></b> as a single-dimensional <b><span style="color:green">array<span style="color:black"></b>)</html> 
- 
-====Return Value==== 
- 
-None 
- 
-====Examples==== 
- 
-===Single-dimensional array, section specified=== 
- 
-<code php> 
-<? 
-  $arr=array(); 
-  $arr['name']="John"; 
-  $arr['age']=33; 
-  ini_put_array("/ini_put_array_example.ini",$arr,"settings"); 
-?> 
-</code> 
- 
-The INI file will contain: 
- 
-<code> 
-[settings] 
-name=John 
-age=33 
-</code> 
- 
-===Two-dimensional array, section NOT specified=== 
- 
-<code php> 
-<? 
-  $arr=array(); 
-  $arr['data']=array(); 
-  $arr['data']['name']="Jeff"; 
-  $arr['data']['age']=39; 
-  $arr['address']=array(); 
-  $arr['address']['city']="Rayville" 
-  $arr['address']['country']="USA" 
-  ini_put_array("/ini_put_array_example.ini",$arr); 
-?> 
-</code> 
- 
-The INI file will contain: 
- 
-<code> 
-[data] 
-name=Jeff 
-age=39 
-[address] 
-city=Rayville 
-country=USA 
-</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_set()]] - Set a value in an INI file 
  
uphp/functions/ini_put_array.txt · Last modified: 2021/09/13 05:57 (external edit)