1

bucketname/plain.txt の場所にあるテキスト ファイルを表示するためにどの関数を使用するかについて混乱しています。

誰かが私が何をすべきかについて光を当てることができますか?

<?php
?>
<html>
<head><title>PHP says hello</title></head>
<body>
<b>
<?php

$client = new Aws\S3\S3Client([/** options **/]);

// Register the stream wrapper from an S3Client object
$client->registerStreamWrapper();

// Download the body of the "key" object in the "bucket" bucket
$data = file_get_contents('s3://vetri/plain.txt');

// Open a stream in read-only mode
if ($stream = fopen('s3://vetri/plain.txt', 'r')) {
    // While the stream is still open
    while (!feof($stream)) {
        // Read 1024 bytes from the stream
        echo fread($stream, 1024);
    }
    // Be sure to close the stream resource when you're done with it
    fclose($stream);
}
?>
</b>
</body>
</html>

4

1 に答える 1