<?php
$mysender2= "";
$myrecepient2= "923336088811,923126812536,923134126153";
$mymessage2 = "this is message";
$api_key = "****";
$api_secret="****";
$to_arr = explode(",", $myrecepient2);
foreach ($to_arr as $b){
$url = "https://rest.nexmo.com/sms/json?" .
"api_key=".$api_key. "&" .
"api_secret=" .$api_secret . "&" .
"from=" . urlencode($mysender2) . "&" .
"to=" . urlencode($b) . "&" .
"text=" .urlencode($mymessage2);
$c = curl_init($url);
// Use SSL
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE);
$html = curl_exec($c);
curl_close ($c);
}
?>
以上腳本將直到完成的過程中一次又一次地運行。如何顯示在程序完成回聲..如「你的過程已完成」響應在過程完成
它是如何一次又一次地運行?你的意思是foreach循環嗎? – 2013-06-22 01:58:56