Ejemplo n.º 1
0
 /**
  * Negotiate & retrieve the clients prefered charset.
  *
  * @param Array $supported Array containing the supported charsets
  *
  * @return Mixed $return The best match of the prefered charsets or NULL if
  *                       there are no supported charsets or the header is not set
  */
 public function parse_accept_charset($supported = [])
 {
     if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
         $this->header->name = 'Accept-Charset';
         $this->header->value = $_SERVER['HTTP_ACCEPT_CHARSET'];
         return $this->header->negotiate($supported);
     }
     return NULL;
 }
Ejemplo n.º 2
0
 /**
  * Negotiate & retrieve the clients prefered charset.
  *
  * @param Array $supported Array containing the supported charsets
  *
  * @return Mixed $return The best match of the prefered charsets or NULL if
  *                       there are no supported charsets or the header is not set
  */
 public function parse_accept_charset($supported = [])
 {
     $this->header->name = 'Accept-Charset';
     $this->header->value = $this->ast['accept-charset'][0];
     return $this->header->negotiate($supported);
 }