'default', 'region' => 'us-east-1', 'version' => '2010-03-31' ]); $protocol = 'sms'; $endpoint = '+1XXX5550100'; $topic = 'arn:aws:sns:us-east-1:111122223333:MyTopic'; try { $result = $SnSclient->subscribe([ 'Protocol' => $protocol, 'Endpoint' => $endpoint, 'ReturnSubscriptionArn' => true, 'TopicArn' => $topic, ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); } // snippet-end:[sns.php.subscribe_text_sms.main] // snippet-end:[sns.php.subscribe_text_sms.complete] // snippet-sourcedescription:[SubscribeTextSMS.php demonstrates how to send a confirmation message as a text message.] // snippet-keyword:[PHP] // snippet-sourcesyntax:[php] // snippet-keyword:[AWS SDK for PHP v3] // snippet-keyword:[Code Sample] // snippet-keyword:[Amazon Simple Notification Service] // snippet-service:[sns] // snippet-sourcetype:[full-example] // snippet-sourcedate:[2018-09-20] // snippet-sourceauthor:[jschwarzwalder]