<?php$to=$_POST["to"];$from=$_POST["from"];$body=$_POST["text"];$subject=$_POST["subject"];$num_attachments=$_POST["attachments"];if($num_attachments){for($i=1;$i<=$num_attachments;$i++){$attachment=$_FILES['attachment'+$i];// $attachment will have all the parameters expected in a the PHP $_FILES object// http://www.php.net/manual/en/features.file-upload.post-method.php#example-369}}?>
<?php$data=file_get_contents("php://input");$events=json_decode($data,true);foreach($eventsas$event){// Here, you now have each event and can process them how you likeprocess_event($event);}