Get the next variable each time it loops foreach

Trinity_Alaska

New Member
I have a php script creating a calendar event for each 'event' that is stored in the post.They are stored as ['listItem'][0], ['listItem'][1] etc for how ever many there are. The code below is working in the sense that it creates a calendar event for each one. However, it is only taking the data from ['listItem'][0]. I need to work out a way to move on to the next variable in the $_POST each time. So at the moment it puts 10 events if there are that many but they all go on the same day.** The eventDate variable just stores a date.Thanks in advance for any help.\[code\]foreach($_POST['listItem'] as $key => $value){$eventDate = trim($_POST['listItem'][0]);echo "BEGIN:VEVENT\n";echo "METHOD:REQUEST\n"; // requied by Outlookecho "DTSTART:".$eventDate."T190000Z\n";echo "DTEND:".$eventDate."T193000Z\n";echo "LOCATION:London\n";echo "DESCRIPTION:Let's get together for New Years Eve\n";echo "SUMMARY:".$eventDate."\n";echo "DTSTAMP:".$eventDate."T190000Z\n";echo "END:VEVENT\n";} \[/code\]
 
Back
Top