write a php script that uses the following curl command and displays the output. It gets the API\_KEY value from environmental variable PINECONE\_API\_KEY
You can use the following PHP script to execute a cURL command that retrieves the `PINECONE_API_KEY` from an environment variable and displays the output. This example assumes you are making a GET request to a hypothetical endpoint.

Here's a sample script:

```php
<?php
// Get the API key from the environment variable
$apiKey = getenv('PINECONE_API_KEY');

// Check if the API key is set
if (!$apiKey) {
    die('Error: PINECONE_API_KEY is not set in the environment variables.');
}

// The URL you want to request
$url = 'https://api.example.com/your-endpoint'; // Replace with your actual endpoint

// Initialize cURL
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey, // Add authorization header
    'Content-Type: application/json' // Set content type to JSON
]);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL Error: ' . curl_error($ch);
} else {
    // Display the response
    echo 'Response from API: ' . $response;
}

// Close cURL session
curl_close($ch);
?>
```


<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.pinecone.io/v1/keys/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
if (strpos($output, 'PINECONE_API_KEY') !== false) {
    echo 'PINECONE_API_KEY is set from the environmental variable: ' . substr($output, strpos($output, 'PINECONE_API_KEY') + 12);
} else {
    echo 'PINECONE_API_KEY is not set.';
}
?>