<?php
    function send_wa($link_send,$api_key,$sender,$number,$message){
        $data = [
            "api_key" => $api_key,
            "sender" => $sender,
            "number" => $number,
            "message" => $message
        ];

        $data_string = json_encode($data);

        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $link_send,
            CURLOPT_CUSTOMREQUEST => 'POST',
            CURLOPT_POSTFIELDS => $data_string,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_VERBOSE => 0,
            CURLOPT_CONNECTTIMEOUT => 0,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_SSL_VERIFYPEER => 0,
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_HTTPHEADER => array(
                'Content-Type: application/json',
                'Content-Length: ' . strlen($data_string)
            ),
        ));

        $response = curl_exec($curl);
        curl_close($curl);
    }
?>