src/Header.php
public static function start_header(
		int $code=200, int $cache=0, array $headers=[]
	) {
		$msg = 'OK';
		extract(self::get_header_string($code));

		$proto = isset($_SERVER['SERVER_PROTOCOL'])
			? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
		static::header("$proto $code $msg");
		if ($cache) {
			$cache = intval($cache);
			$expire = time() + $cache;
			static::header("Expires: " .
				gmdate("D, d M Y H:i:s", $expire)." GMT");
			static::header("Cache-Control: must-revalidate");
		} else {
			static::header("Expires: Mon, 27 Jul 1996 07:00:00 GMT");
			static::header(
				"Cache-Control: no-store, no-cache, must-revalidate");
			static::header("Cache-Control: post-check=0, pre-check=0");
			static::header("Pragma: no-cache");
		}
		static::header("Last-Modified: " .
			gmdate("D, d M Y H:i:s")." GMT");
		static::header("X-Powered-By: Zap!", true);

		if (!$headers)
			return;
		foreach ($headers as $header)
			static::header($header);
	}
public static function start_header(
		int $code=200, int $cache=0, array $headers=[]
	) {
		$msg = 'OK';
		extract(self::get_header_string($code));

		$proto = isset($_SERVER['SERVER_PROTOCOL'])
			? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
		static::header("$proto $code $msg");
		if ($cache) {
			$cache = intval($cache);
			$expire = time() + $cache;
			static::header("Expires: " .
				gmdate("D, d M Y H:i:s", $expire)." GMT");
			static::header("Cache-Control: must-revalidate");
		} else {
			static::header("Expires: Mon, 27 Jul 1996 07:00:00 GMT");
			static::header(
				"Cache-Control: no-store, no-cache, must-revalidate");
			static::header("Cache-Control: post-check=0, pre-check=0");
			static::header("Pragma: no-cache");
		}
		static::header("Last-Modified: " .
			gmdate("D, d M Y H:i:s")." GMT");
		static::header("X-Powered-By: Zap!", true);

		if (!$headers)
			return;
		foreach ($headers as $header)
			static::header($header);
	}
public static function start_header ( int $ code = 200 , int $ cache = 0 , array $ headers = [ ] ) { $ msg = 'OK' ; extract ( self :: get_header_string ( $ code ) ) ; $ proto = isset ( $ _SERVER [ 'SERVER_PROTOCOL' ] ) ? $ _SERVER [ 'SERVER_PROTOCOL' ] : 'HTTP/1.1' ; static :: header ( "$proto $code $msg" ) ; if ( $ cache ) { $ cache = intval ( $ cache ) ; $ expire = time ( ) + $ cache ; static :: header ( "Expires: " . gmdate ( "D, d M Y H:i:s" , $ expire ) . " GMT" ) ; static :: header ( "Cache-Control: must-revalidate" ) ; } else { static :: header ( "Expires: Mon, 27 Jul 1996 07:00:00 GMT" ) ; static :: header ( "Cache-Control: no-store, no-cache, must-revalidate" ) ; static :: header ( "Cache-Control: post-check=0, pre-check=0" ) ; static :: header ( "Pragma: no-cache" ) ; } static :: header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" ) ; static :: header ( "X-Powered-By: Zap!" , true ) ; if ( ! $ headers ) return ; foreach ( $ headers as $ header ) static :: header ( $ header ) ; }
Start sending response headers.

@param int $code HTTP code.
@param int $cache Cache age, 0 for no cache.
@param array $headers Additional headers.
Start sending response headers .