Function __global->cms_get_headers

Definitions

sources/global4.php

  • LEGACY: Fetches all the headers sent by the server in response to a HTTP request.This is legacy code for PHP's get_headers to work around the change of $parse to a boolean in PHP 8.0.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url URLPATH No No required parameter N/A N/A The target URL
$parse BINARY No No 0 N/A N/A Whether to parse into a map
$context ?resource No No Null N/A N/A A stream context to attach to (null: no special context)

Returns

  • Result (false: error)
  • Type: ~array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * LEGACY: Fetches all the headers sent by the server in response to a HTTP request.This is legacy code for PHP's get_headers to work around the change of $parse to a boolean in PHP 8.0.
 *
 * @param  URLPATH $url The target URL
 * @param  BINARY $parse Whether to parse into a map
 * @param  ?resource $context A stream context to attach to (null: no special context)
 * @return ~array Result (false: error)
 */

function cms_get_headers(string $url, int $parse = 0, $context = null)