SMS/알림을 보내고받을 수있는 많은 웹 서비스가 있습니다. PHP 자체는이 기능을 자체적으로 지원하지 않습니다. Twilio와 같은 서비스를 사용하면이 작업을 수행 할 수 있습니다. 자신의 스마트 폰 또는 친구에게 메시지를 보낼 수 있습니다.
example :
<?php
require "Services/Twilio.php";
// Step 2: set our AccountSid and AuthToken from www.twilio.com/user/account
$AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
// Step 3: instantiate a new Twilio Rest Client
$client = new Services_Twilio($AccountSid, $AuthToken);
// Step 4: make an array of people we know, to send them a message.
// Feel free to change/add your own phone number and name here.
$people = array(
"+14158675309" => "Curious George",
"+14158675310" => "Boots",
"+14158675311" => "Virgil",
);
// Step 5: Loop over all our friends. $number is a phone number above, and
// $name is the name next to it
foreach ($people as $number => $name) {
$sms = $client->account->sms_messages->create(
// Step 6: Change the 'From' number below to be a valid Twilio number
// that you've purchased, or the (deprecated) Sandbox number
"YYY-YYY-YYYY",
// the number we are sending to - Any phone number
$number,
// the sms body
"Hey $name, Monkey Party at 6PM. Bring Bananas!"
);
// Display a confirmation message on the screen
echo "Sent message to $name";
}
는 문서 here를 참조하십시오.
희망이 도움이됩니다.
감사합니다. 그래, 나는 PHP가 기본적으로 이것을 할 수 없다는 것을 이해하고 이것을 제거하기 위해 lib 또는 api가 필요할 것이다. Twilio는 좋을 것 같습니다 (웹 서버에서 SMS 메시지를 보내면 좋을 것입니다!) 그러나 나는 그것이 무료가 아닐 것이라고 생각합니다. –
그들은 [trial] (http://www.twilio.com/help/faq/twilio-basics/how-does-twilios-free-trial-work) 버전을 제공합니다. 또는 원하는 경우 저렴한 [대안] (https://www.quora.com/Is-there-a-cheaper-alternative-to-Twilio)이 많이 있습니다. –
재판을 확인하겠습니다. 그러나 SMS는 휴대 전화 제공 업체와 기타 등등 (비용과 난제가있는 제한 사항)을 처리해야하므로 인터넷 프로토콜에서만 완전히 작동하는 솔루션, 즉 WhatsApp, Kik 또는 Viber와 같은 채팅 앱을 선호합니다. –