HOME > > > > >

Net_UserAgent_Mobile_SoftBank

サンプル

初期化

  1. <?php
  2. require_once 'Net/UserAgent/Mobile.php';
  3. $mobile = Net_UserAgent_Mobile::factory('SoftBank/2.0/001SH/SHJ001 Java/Java/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1');
  4. ?>

name

  1. <?php
  2. var_dump($mobile->name);
  3. ?>

実行結果

string(8) "SoftBank"

version

  1. <?php
  2. var_dump($mobile->version);
  3. ?>

実行結果

string(3) "2.0"

getUserAgent()

  1. <?php
  2. var_dump($mobile->getUserAgent());
  3. ?>

実行結果

string(79) "SoftBank/2.0/001SH/SHJ001 Java/Java/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1"

getHeader($header)

  1. <?php
  2. echo htmlspecialchars($mobile->getHeader('REFERER'), ENT_QUOTES, mb_internal_encoding());
  3. ?>

実行結果

getName()

  1. <?php
  2. var_dump($mobile->getName());
  3. ?>

実行結果

string(8) "SoftBank"

getDisplay()

  1. <?php
  2. var_dump($mobile->getDisplay());
  3. ?>

実行結果

object(Net_UserAgent_Mobile_Display)#162 (6) { ["_width"]=> int(0) ["_height"]=> int(0) ["_depth"]=> int(0) ["_color"]=> bool(false) ["_widthBytes"]=> int(0) ["_heightBytes"]=> int(0) }

getVersion()

  1. <?php
  2. var_dump($mobile->getVersion());
  3. ?>

実行結果

string(3) "2.0"

noMatch()

  1. <?php
  2. $error = $mobile->noMatch();
  3. echo $error->getMessage();
  4. ?>

実行結果

SoftBank/2.0/001SH/SHJ001 Java/Java/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1: might be new variants. Please contact the author of Net_UserAgent_Mobile!

parse($userAgent)

  1. <?php
  2. var_dump($mobile->parse($userAgent));
  3. ?>

実行結果

NULL

makeDisplay()

  1. <?php
  2. var_dump($mobile->makeDisplay());
  3. ?>

実行結果

object(Net_UserAgent_Mobile_Display)#164 (6) { ["_width"]=> int(0) ["_height"]=> int(0) ["_depth"]=> int(0) ["_color"]=> bool(false) ["_widthBytes"]=> int(0) ["_heightBytes"]=> int(0) }

isDoCoMo()

  1. <?php
  2. var_dump($mobile->isDoCoMo());
  3. ?>

実行結果

bool(false)

isJPhone()

  1. <?php
  2. var_dump($mobile->isJPhone());
  3. ?>

実行結果

bool(true)

isVodafone()

  1. <?php
  2. var_dump($mobile->isVodafone());
  3. ?>

実行結果

bool(true)

isEZweb()

  1. <?php
  2. var_dump($mobile->isEZweb());
  3. ?>

実行結果

bool(false)

isAirHPhone()

  1. <?php
  2. var_dump($mobile->isAirHPhone());
  3. ?>

実行結果

bool(false)

isNonMobile()

  1. <?php
  2. var_dump($mobile->isNonMobile());
  3. ?>

実行結果

bool(false)

isTUKa()

  1. <?php
  2. var_dump($mobile->isTUKa());
  3. ?>

実行結果

bool(false)

isWAP1()

  1. <?php
  2. var_dump($mobile->isWAP1());
  3. ?>

実行結果

bool(false)

isWAP2()

  1. <?php
  2. var_dump($mobile->isWAP2());
  3. ?>

実行結果

bool(false)

getCarrierShortName()

  1. <?php
  2. var_dump($mobile->getCarrierShortName());
  3. ?>

実行結果

string(1) "S"

getCarrierLongName()

  1. <?php
  2. var_dump($mobile->getCarrierLongName());
  3. ?>

実行結果

string(8) "SoftBank"

isSoftBank()

  1. <?php
  2. var_dump($mobile->isSoftBank());
  3. ?>

実行結果

bool(true)

isWillcom()

  1. <?php
  2. var_dump($mobile->isWillcom());
  3. ?>

実行結果

bool(false)

getModel()

  1. <?php
  2. var_dump($mobile->getModel());
  3. ?>

実行結果

string(5) "001SH"

getRawModel()

  1. <?php
  2. var_dump($mobile->getRawModel());
  3. ?>

実行結果

string(5) "001SH"

getUID()

  1. <?php
  2. var_dump($mobile->getUID());
  3. ?>

実行結果

NULL