What are the best practices for handling authorization headers in cUrl requests in PHP?

When making cURL requests in PHP that require authorization headers, it is important to properly handle and include these headers for authentication. One common way to do this is by using the `CURLOPT_HTTPHEADER` option in the cURL request to set the Authorization header with the necessary credentials.

// Set the authorization header with credentials
$authorization = 'Authorization: Bearer YOUR_ACCESS_TOKEN';

// Initialize cURL session
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, 'https://api.example.com/endpoint');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array($authorization));

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

// Close cURL session
curl_close($ch);

// Handle response
echo $response;