<?php
send( "halleluyah","test msg","+254715745434");

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 ='<?xml version="1.0"?>
        <smslist>
            <sms>
                <user>mncconsult</user>
                <password>**Mnc20!</password>
                <message>'.$salutation.','.$_text.' '. $signature.'</message>
                <mobiles>'.$phone.'</mobiles>
                <senderid>MNC_Consult</senderid>
                <group>-1</group>
                <clientsmsid>0</clientsmsid>
            </sms>
        </smslist>'; 
         
        $URL1 = "http://messaging.advantasms.com/bulksms/sendsms.jsp?";
         
                    $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/xml'));
                    curl_setopt($ch1, CURLOPT_POSTFIELDS, "$xml_data1");
                    curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
                    $output = curl_exec($ch1);
                    echo($output);
                    curl_close($ch1);
       
    }
        
    }
    ?>