note 119543 added to function.parse-ini-file

From: Date: Sun, 03 Jul 2016 20:49:07 +0000
Subject: note 119543 added to function.parse-ini-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-205870@lists.php.net to get a copy of this message
This function for save ini files function array_to_ini($array,$out="") { $t=""; $q=false; foreach($array as $c=>$d) { if(is_array($d))$t.=array_to_ini($d,$c); else { if($c===intval($c)) { if(!empty($out)) { $t.="\r\n".$out." = \"".$d."\""; if($q!=2)$q=true; } else $t.="\r\n".$d; } else { $t.="\r\n".$c." = \"".$d."\""; $q=2; } } } if($q!=true && !empty($out)) return "[".$out."]\r\n".$t; if(!empty($out)) return $t; return trim($t); } function save_ini_file($array,$file) { $a=array_to_ini($array); $ffl=fopen($file,"w"); fwrite($ffl,$a); fclose($ffl); } ---- Server IP: 72.52.91.14 Probable Submitter: 2a02:2168:13c7:5500:5da3:cf75:5825:edc8 ---- Manual Page -- http://php.net/manual/en/function.parse-ini-file.php Edit -- https://master.php.net/note/edit/119543 Del: integrated -- https://master.php.net/note/delete/119543/integrated Del: useless -- https://master.php.net/note/delete/119543/useless Del: bad code -- https://master.php.net/note/delete/119543/bad+code Del: spam -- https://master.php.net/note/delete/119543/spam Del: non-english -- https://master.php.net/note/delete/119543/non-english Del: in docs -- https://master.php.net/note/delete/119543/in+docs Del: other reasons-- https://master.php.net/note/delete/119543 Reject -- https://master.php.net/note/reject/119543 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205870) next »