use GuzzleHttp\Client; function getMovies() { $client = new Client(['base_uri' => 'https://api.example.com/']); $response = $client->request('GET', 'movies'); return $response->getBody()->getContents(); } echo getMovies();
function readFromFile($path) { $data = file_get_contents($path); return $data; } echo readFromFile('/path/to/file.txt');This code reads the contents of the specified `file.txt` file located at `/path/to/` and returns it as a string. The `file_get_contents` function is a built-in function in PHP for reading the contents of a file. It is part of the `php5` or `php7` package built-in into PHP.