'batchinvite', 'group' => $GROUP, 'password' => $PASSWORD, 'avatars' => wasArrayToCSV($invites) ); #### # III. Escape the data to be sent to Corrade. array_walk($params, function(&$value, $key) { $value = urlencode($key)."=".urlencode($value); } ); $postvars = implode('&', $params); #### # IV. Use curl to send the message. if (!($curl = curl_init())) { print 0; return; } curl_setopt($curl, CURLOPT_URL, $URL); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postvars); $result = curl_exec($curl); curl_close($curl); #### # V. Grab the status of the command. $status = urldecode( wasKeyValueGet( "success", $result ) ); #### # VI. Check the status of the command. switch($status) { case "False": return -1; } #### # V. Return any avatars or UUIDs for which invites could not be sent. echo implode( PHP_EOL, wasCSVToArray( urldecode( wasKeyValueGet( "data", $result ) ) ) ); return 0; ?>