예제 #1
0
 public static function xhtml_or_html()
 {
     $content_match = array('type' => array('text/html', 'application/xhtml+xml'), 'app_preference' => array(1, 0.9));
     $content_match = content_negotiation::mime_all_negotiation($content_match);
     if ($content_match['q_value'][0] == 0 && $content_match['q_value'][1] == 0) {
         return 'text/html';
     } else {
         return $content_match['type'][0];
     }
 }
예제 #2
0
 public static function language_all_negotiation(array $app_types = array())
 {
     if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
         return content_negotiation::generic_negotiation($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'all', $app_types);
     } else {
         return false;
     }
 }