# [php] 네이버 클라우드 플랫폼 버킷목록 가져오기

- 주소: https://duotone.co.kr/entry/php-%EB%84%A4%EC%9D%B4%EB%B2%84-%ED%81%B4%EB%9D%BC%EC%9A%B0%EB%93%9C-%ED%94%8C%EB%9E%AB%ED%8F%BC-%EB%B2%84%ED%82%B7%EB%AA%A9%EB%A1%9D-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0
- 글쓴이: 서기㏇
- 카테고리: 개발·프로그래밍
- 작성일: 2020-09-08
- 태그: Bucket, naver, object, Stroage, 네이버, 버킷, 클라우드플랫폼

```
    require '/www/aws/aws-autoloader.php';

    $accessKey = "key";
    $secretKey = "secret";

    use Aws\S3\S3Client;
    use Aws\S3\Exception\S3Exception;

    $credentials = new Aws\Credentials\Credentials($accessKey, $secretKey);

    $s3 = new S3Client([
        'version' => 'latest',
        'region' => 'kr-standard',
        'endpoint' => 'https://kr.object.ncloudstorage.com',
        'credentials' => $credentials
        ]);

    $result = $s3->listBuckets([]);

    echo "
";

    for($i=0;$i<count($result[Buckets]);$i++)
    {
        echo $result[Buckets][$i][Name];
        echo "
";
    }

```
