I ran into the Problem that I had to write a PHP program that generates individual variable names for objects (a script to create an ics file).
I’m getting the events from the Database and then I use a for loop to create the object for each event.
the PHP code
//get data from DB
for($i = 0; $i < $count_events; $i++){
...
${vevent.$i} = & $v->newComponent( "vevent" );
${vevent.$i}->setProperty( "dtstart", $start);
${vevent.$i}->setProperty( "dtend", $end);
...
}
${vevent.$i} creates a new name every time the program runs trough the for loop, adding the counter to the variable name.
I used this code for a calendar project I was working on. I needed to generate individual variable names in a for loop to creat an [[ics]] file. The events are stored in a MySQL Database. I’m using this little Script to generate the ics file. This file can be imported into Google Calendar or any other Calendar Program.