How to get the phone number returned by Alibaba Cloud
韦锦明
韦锦明 2019-05-13 12:00:35
0
1
872

<?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 麻烦大家了。

韦锦明
韦锦明

reply all(1)
韦锦明

Need to extract independent digital numbers

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template