首页 >社区问答列表 >怎么获取 阿里云返回的电话号码

怎么获取 阿里云返回的电话号码

<?php

use AlibabaCloud\Client\AlibabaCloud;

use AlibabaCloud\Client\Exception\ClientException;

use AlibabaCloud\Client\Exception\ServerException;


// Download:https://github.com/aliyun/openapi-sdk-php

// Usage:https://github.com/aliyun/openapi-sdk-php/blob/master/README.md


AlibabaCloud::accessKeyClient('<accessKeyId>', '<accessSecret>')

->regionId('cn-hangzhou') // replace regionId as you need

->asDefaultClient();


try {

$result = AlibabaCloud::rpc()

->product('Dyplsapi')

// ->scheme('https') // https | http

->version('2017-05-25')

->action('BindAxn')

->method('POST')

->options([

'query' => [


],

])

->request();

print_r($result->toArray());

} catch (ClientException $e) {

echo $e->getErrorMessage() . PHP_EOL;

} catch (ServerException $e) {

echo $e->getErrorMessage() . PHP_EOL;

}



Array ( [Message] => OK [RequestId] => B0955ACE-D7E7-49A0-B39D-E706CD0C7802 [Code] => OK [SecretBindDTO] => Array ( [SecretNo] => 9501364081436 [SubsId] => 319916057719665412 ) ) 


返回是这样。我需要提取

[SecretNo] => 9501364081436 

[SubsId] => 319916057719665412 


刚刚学php 麻烦大家了。