Example #1
0
File: UA.php Project: fromearth/php
 /**
  * キャリア解析
  * @return void
  */
 private static function scanCarrier()
 {
     $UA = self::getUserAgent();
     if (strpos($UA, 'DoCoMo') !== false) {
         // DoCoMo
         self::$carrier = 'docomo';
     } elseif (strpos($UA, 'UP.Browser') !== false) {
         // au
         self::$carrier = 'au';
     } elseif (preg_match('/SoftBank|Vodafone|J-PHONE|SMOT/', $UA) === 1) {
         // SoftBank
         self::$carrier = 'softbank';
     } elseif (strpos($UA, 'WILLCOM') !== false) {
         // WILLCOM
         self::$carrier = 'willcom';
     } elseif (strpos($UA, 'emobile') !== false) {
         // eモバイル
         self::$carrier = 'emobile';
     } else {
         // 不明
         self::$carrier = 'unknown';
     }
 }