We recommend using the Google API Client PHP library for this, as Firebase Storage is backed by Google Cloud Storage. Firebase Storage doesn't provide a PHP client for front end code though.
From the GCS PHP example code:
// composer autoloading
require_once __DIR__ . '/vendor/autoload.php';
// grab the first argument
if (empty($argv[1])) {
die("usage: php listBuckets [project_id]
");
}
$projectId = $argv[1];
// Authenticate your API Client
$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(Google_Service_Storage::DEVSTORAGE_FULL_CONTROL);
$storage = new Google_Service_Storage($client);
/**
* Google Cloud Storage API request to retrieve the list of buckets in your project.
*/
$buckets = $storage->buckets->listBuckets($projectId);
foreach ($buckets['items'] as $bucket) {
printf("%s
", $bucket->getName());
}