Hey everybody,

I'm new the list and to PHP, so I thought I'd launch right in with a
question.

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
year = 2003
venue = another club
description = this is another event

Each one of these headers sections represents the start of a new event.  So,
my code does the following:

$EVENTS = parse_ini_file('./data/events', TRUE);
while($key = key($EVENTS))
{
 $$key = current($EVENTS); //variable variables
 next($EVENTS);
}

The problem is that when I try to print the values for $venue, $day, etc, I
only get the values for the last section encountered.  I need a way to get
the values of all the events - do my section heads need to be unique, or can
I continue to use the same format in my ini file?

Thanks in advance!

-Erich-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to