Example #1

Retrieving all buckets from a S3 account

The following examples illustrates how to retrieve all buckets of a given S3 account. All you need to replace in the snippet are the $key and $secret variables.

<?php
require_once 'Services/Amazon/S3.php';

$key    'your key';
$secret 'your secret';

$s3 Services_Amazon_S3::getAccount($key$secret);

echo 
'<ul>';
foreach (
$s3->getBuckets() as $bucket) {
    echo 
"<li>{$bucket->name}</li>";
}
echo 
'</ul>';

?>
Introduction to Services_Amazon_S3 (Previous) Example #2 and #3 (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.