psFileKeyValWrite() Write Key=Value to txt file
Description:
This will write an array in key = val format to a text file
Usage:
psFileKeyValWrite($fName,$ary,{$sepertor})
Example:
$table['name'] = "Jon"; $table['ID'] = "A60244"; psFileKeyVal("/tmp/somefile.txt",$table);
/tmp/somefile.txt will have: name=Jon ID=A60244
Code:
function psFileKeyValWrite($wFile,$ary,$s="=") { $fp = fopen($wFile,"w"); foreach ($ary as $key=>$val) { fwrite($fp,"{$key}{$s}{$val}\r\n"); } fclose($fp); }
Changlelog:
|
|