I have a file which contains the following syntax:
; Events listings
[event]
month = january
day = 23
year = 2003
venue = some club
description = this is an event
[event]
month = january
day = 12
interesting function, i had not seen it yet.
You could have a look at the alternative function mentioned by the users 'seb' and 'Tom' in the online manual
http://nl.php.net/manual/nl/function.parse-ini-file.php, at least you can tweak that so the values get added to arrays.
Or you could see whether this will work:
[event]
month[]=januari
[event]
month[]=februari
I doubt whether it would work, the idea is that in this case $month[0] would be januari and $month[1] februari.
$EVENTS = parse_ini_file('./data/events', TRUE);
while($key = key($EVENTS))
{
$$key = current($EVENTS); //variable variables
next($EVENTS);
}
if you ask me, i would do it like this:
while (list ($key, $val) = each ($_POST)) {
{
$$key = $val;
}