- Timestamp:
- 2010/11/06 21:19:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camp/camp-2_5-E/data/module/Net/UserAgent/Mobile.php
r18188 r19029 396 396 } 397 397 398 // }}} 399 // {{{ isSmartphone() 400 401 /** 402 * Checks whether or not the user agent is Smartphone by a given user agent string. 403 * 404 * @param string $userAgent 405 * @return boolean 406 * @since Method available since Release 0.31.0 407 */ 408 function isSmartphone($userAgent = null) 409 { 410 if (is_null($userAgent)) { 411 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 412 } 413 414 $useragents = array( 415 'iPhone', // Apple iPhone 416 'iPod', // Apple iPod touch 417 'Android', // 1.5+ Android 418 'dream', // Pre 1.5 Android 419 'CUPCAKE', // 1.5+ Android 420 'blackberry9500', // Storm 421 'blackberry9530', // Storm 422 'blackberry9520', // Storm v2 423 'blackberry9550', // Storm v2 424 'blackberry9800', // Torch 425 'webOS', // Palm Pre Experimental 426 'incognito', // Other iPhone browser 427 'webmate' // Other iPhone browser 428 ); 429 430 $pattern = implode("|", $useragents); 431 return preg_match('/['.$pattern.']/', $userAgent); 432 } 433 398 434 /**#@-*/ 399 435
Note: See TracChangeset
for help on using the changeset viewer.
