PHP code example of aliyunapi / php-aliyun-open-api-search

1. Go to this page and download the library: Download aliyunapi/php-aliyun-open-api-search library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aliyunapi / php-aliyun-open-api-search example snippets


php composer.phar 

"aliyunapi/php-aliyun-open-api-search": "~1.0"

$client = new \aliyun\search\Client([
    'accessKeyId' => '123456',
    'accessSecret' => '123456'
    'appName' => 'search',
    'baseUri' => 'http://opensearch-cn-hangzhou.aliyuncs.com',
]);

//发送接口请求
$response = $client->getApps();

print_r($response);


exit;