function print_info()
{
    $browserSearch = array('ie7up', 'ie6up', 'firefox', 'gecko', 'ns6up', 'ns4', 'nav', 'safari');
    println('User Agent String: ' . Net_UserAgent_Detect::getUserAgent());
    println('Browser String: ' . Net_UserAgent_Detect::getBrowserString());
    println('OS String: ' . Net_UserAgent_Detect::getOSString());
    println('Browser flag: ' . Net_UserAgent_Detect::getBrowser($browserSearch));
    println('Has "popups disabled" quirk: ' . (Net_UserAgent_Detect::hasQuirk('popups_disabled') ? 'Yes' : 'No'));
    println('Has "dom" feature: ' . (Net_UserAgent_Detect::hasFeature('dom') ? 'Yes' : 'No'));
    println('Has "ajax" feature: ' . (Net_UserAgent_Detect::hasFeature('ajax') ? 'Yes' : 'No'));
    println('Has "svg" feature: ' . (Net_UserAgent_Detect::hasFeature('svg') ? 'Yes' : 'No'));
    println('Javascript version: ' . Net_UserAgent_Detect::getFeature('javascript'));
    $languages = array('fr', 'de', 'en-us');
    println('Accept Language: ' . Net_UserAgent_Detect::getAcceptType($languages, 'language'));
}
Beispiel #2
0
 /**
  * Check the accept types for the current browser.
  *
  * To keep track of the mime-types, languages, charsets and encodings
  * that each browser accepts we use associative arrays for each type.
  * This function checks the array for the given type and determines if
  * the browser accepts it.
  *
  * @param  string $in_value values to check
  * @param  string $in_type type of accept
  *
  * @access public
  * @return bool whether or not the value is accept for this type
  */
 function hasAcceptType($in_value, $in_type)
 {
     return (bool) Net_UserAgent_Detect::getAcceptType((array) $in_value, $in_type);
 }