public function subscribe($topicArn, $protocol, $endpoint) {
		if(empty($topicArn) || empty($protocol) || empty($endpoint)) {
			throw new InvalidArgumentException('Must supply a TopicARN, Protocol and Endpoint to subscribe to a topic');
		}

		$response = $this->_request('Subscribe', array(
			'TopicArn' => $topicArn,
			'Protocol' => $protocol,
			'Endpoint' => $endpoint
		));

		return strval($response->SubscribeResult->SubscriptionArn);
	}
public function subscribe($topicArn, $protocol, $endpoint) {
		if(empty($topicArn) || empty($protocol) || empty($endpoint)) {
			throw new InvalidArgumentException('Must supply a TopicARN, Protocol and Endpoint to subscribe to a topic');
		}

		$response = $this->_request('Subscribe', array(
			'TopicArn' => $topicArn,
			'Protocol' => $protocol,
			'Endpoint' => $endpoint
		));

		return strval($response->SubscribeResult->SubscriptionArn);
	}
public function subscribe ( $ topicArn , $ protocol , $ endpoint ) { if ( empty ( $ topicArn ) || empty ( $ protocol ) || empty ( $ endpoint ) ) { throw new InvalidArgumentException ( 'Must supply a TopicARN, Protocol and Endpoint to subscribe to a topic' ) ; } $ response = $ this -> _request ( 'Subscribe' , array ( 'TopicArn' => $ topicArn , 'Protocol' => $ protocol , 'Endpoint' => $ endpoint ) ) ; return strval ( $ response -> SubscribeResult -> SubscriptionArn ) ; }
Subscribe to a topic

@link http://docs.amazonwebservices.com/sns/latest/api/API_Subscribe.html
@param string $topicArn
@param string $protocol - http/https/email/email-json/sms/sqs
@param string $endpoint
@return string $SubscriptionArn
@throws InvalidArgumentException
Subscribe to a topic