src/CMobileDetector.php
public function setHttpHeaders($httpHeaders = null)
	{
		// use global _SERVER if $httpHeaders aren't defined
		if (!is_array($httpHeaders) || !count($httpHeaders)) {
			$httpHeaders = $_SERVER;
		}

		// clear existing headers
		$this->httpHeaders = array();

		// Only save HTTP headers. In PHP land, that means only _SERVER vars that
		// start with HTTP_.
		foreach ($httpHeaders as $key => $value) {
			if (substr($key, 0, 5) === 'HTTP_') {
				$this->httpHeaders[$key] = $value;
			}
		}

		// In case we're dealing with CloudFront, we need to know.
		$this->setCfHeaders($httpHeaders);
	}
public function setHttpHeaders($httpHeaders = null)
	{
		// use global _SERVER if $httpHeaders aren't defined
		if (!is_array($httpHeaders) || !count($httpHeaders)) {
			$httpHeaders = $_SERVER;
		}

		// clear existing headers
		$this->httpHeaders = array();

		// Only save HTTP headers. In PHP land, that means only _SERVER vars that
		// start with HTTP_.
		foreach ($httpHeaders as $key => $value) {
			if (substr($key, 0, 5) === 'HTTP_') {
				$this->httpHeaders[$key] = $value;
			}
		}

		// In case we're dealing with CloudFront, we need to know.
		$this->setCfHeaders($httpHeaders);
	}
public function setHttpHeaders ( $ httpHeaders = null ) { // use global _SERVER if $httpHeaders aren't defined if ( ! is_array ( $ httpHeaders ) || ! count ( $ httpHeaders ) ) { $ httpHeaders = $ _SERVER ; } // clear existing headers $ this -> httpHeaders = array ( ) ; // Only save HTTP headers. In PHP land, that means only _SERVER vars that // start with HTTP_. foreach ( $ httpHeaders as $ key => $ value ) { if ( substr ( $ key , 0 , 5 ) === 'HTTP_' ) { $ this -> httpHeaders [ $ key ] = $ value ; } } // In case we're dealing with CloudFront, we need to know. $ this -> setCfHeaders ( $ httpHeaders ) ; }
Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.

@param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
the headers. The default null is left for backwards compatibility.
Set the HTTP Headers . Must be PHP - flavored . This method will reset existing headers .