public function setMobile($userAgent = null) { if ($userAgent) { $this->mobileUserAgent = $userAgent; } $_SERVER['HTTP_USER_AGENT'] = $this->mobileUserAgent; opMobileUserAgent::resetInstance(); }
public function setMobile($userAgent, $headers = array()) { $_SERVER['HTTP_USER_AGENT'] = $userAgent; foreach ($headers as $key => $header) { if (null === $header) { unset($_SERVER[$key]); } else { $_SERVER[$key] = $header; } } opMobileUserAgent::resetInstance(); }