Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function glip_webhook($webhook_url,$title, $body, $activity,$icon ='' ) {
- $json = json_encode(array('icon'=>$icon,'activity'=>$activity,'title'=>$title,'body'=>$body) );
- $ch = curl_init($webhook_url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($json))
- );
- $r = curl_exec($ch);
- return $r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement