note 78579 deleted from function.parse-ini-file by felipe
| From: | felipe@php.net | Date: | Sun, 16 Dec 2007 12:15:15 +0000 |
| Subject: | note 78579 deleted from function.parse-ini-file by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133685@lists.php.net to get a copy of this message | ||
Note Submitter: egingell at sisna dot com
----
<?php
// Parse an INI formatted string. Requires read/write access to the filesystem.
function parse_ini_text ($text, $sections = false) {
$temp_dir = 'wherever that might be';
$prefix = 'whatever that might be';
$file = tempnam($temp_dir, $prefix); // File name should be as unique as possible to avoid
collisions.
$fp = fopen($file, 'w');
fwrite($fp, $text);
fclose($fp); // Required on windows or the next line may fail!
$ret = parse_ini_file($file, $sections);
unlink($file);
return $ret;
}
?>