<?php

//send( "good morning customer","this is a test masage from mnc . have a good day","+254793288674");

function send($salutation,$_text,$phone){
    $phone_numbers=explode(',',$phone);
    foreach ($phone_numbers as $key => $phone) {
      $signature = " With us, you are in safe hands. Call +254 720 502 505 , www.mncconsulting.co.ke";
    $xml_data1 = array(
        "apikey" =>"09f113bf7c12953b15fae2a1247ab0b2",
        "partnerID" => "3698",
        "message" => $salutation.','.$_text.' '. $signature,
        "shortcode" =>"MNC_Consult",
        "mobile"=>"$phone"
  );
  $xml_data1 = json_encode($xml_data1);
     
    $URL1 = "https://quicksms.advantasms.com/api/services/sendsms/";
     
                $ch1 = curl_init($URL1);			
                curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, 0);
                curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, 0);
                curl_setopt($ch1, CURLOPT_POST, 1);
                curl_setopt($ch1, CURLOPT_ENCODING, 'UTF-8');
                curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
                curl_setopt($ch1, CURLOPT_POSTFIELDS, "$xml_data1");
                curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
                $output = curl_exec($ch1);
                echo "$output";
                curl_close($ch1);
   
}
    
}
?>