function notif($title,$long_message,$title_message,$long_message_preview,$message_level,$silent,$action_loc_key,$run_command,$sound){ $notif_post_data = array ( "user_credentials" => "credential", "notification[message]" => $title, "notification[long_message]" => $long_message, "notification[title]" => $title_message, "notification[long_message_preview]" => $long_message_preview, "notification[message_level]" => $message_level, "notification[silent]" => $silent, "notification[action_loc_key]" => $action_loc_key, "notification[run_command]" => $run_command, "notification[sound]" => $sound.".caf", ); $notif_post_data_encoded = ""; foreach ( $notif_post_data as $k => $v ) $notif_post_data_encoded .= ( $notif_post_data_encoded ? "&" : "" ) . rawurlencode( $k ) ."=". rawurlencode( $v ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, "[https://www.appnotifications.com/account/notifications.xml]" ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $notif_post_data_encoded ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_exec( $ch ); curl_close( $ch ); unset( $notif_post_data, $notif_post_data_encoded ); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question