1. Support mass sending
2. Convert Chinese to Pinyin for sending
If you need to send multiple accounts in bulk, separate them with English commas (,) (86159..,86159..). The message content does not support Chinese. The system will automatically Convert to Pinyin (in order to distinguish Pinyin, the first letter of Pinyin is capitalized) to ensure that the message can be sent normally (enter "I am Xuan Feng" and the text message content is "Wo Shi Xuan Feng").
Copy the code The code is as follows:
/*
Tips: If you need to send multiple accounts in bulk, separate them with English commas (,) (86159..,86159..). The message content does not support Chinese.
The system will automatically Convert to Pinyin (in order to distinguish Pinyin, the first letter of Pinyin is capitalized),
Ensure that the message can be sent normally (input "I am Xuan Feng" text message content as "Wo Shi Xuan Feng")
Required PHP extension: curl. The character encoding is all GBK (taking Pinyin conversion into account)
*/
//Introducing files required for Pinyin conversion
include("libs/pinyin.php");
include "libs/googlevoice.class.php";
#Set up google voice Account password
$username="username@gmail.com";
$password="password";
//Accept numbers, separate multiple numbers with "," (86159..,86159..)
$sendto ="8615900000000 ,8613400000000";
//Message content
$message = "I am from heqee.com";
/*
Convert Chinese to Pinyin and the program automatically recognizes Chinese and replaces it,
This function is purely for entertainment in my opinion and can be adjusted according to the actual situation Decide whether to add.
*/
//$message = zh2pinyin($message);
//Instantiation (required)
$sms = new GoogleVoice($username,$password);
//Return results
//Text sent to 86134...
echo $sms ->send($sendto,$message);
?>
The above introduces the Google Voice Google Voice SMS sending interface PHP open source version 20105 update, including the content of Google Voice. I hope it will be helpful to friends who are interested in PHP tutorials.