Can anyOne Combain It Plz ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can anyOne Combain It Plz ???

    This code will detect mobile name by default browser.

    PHP Code:
    <?php 
    $mobile 
    strtok(getenv('HTTP_USER_AGENT'), "/");
    echo 
    $mobile;
    ?>
    This code detect mobile model number while u using operamini.

    PHP Code:
    <?
    $mobile = strtok(getenv('HTTP_X_OPERAMINI_PHONE_UA'), "/");
    echo $mobile;
    ?>
    Can Anyone Plz Combine Both Code as One ?

    Like......

    if From Default Browser, output will :
    Browser: n97

    Or

    if User From Opera Mini, Output will..
    Browser: Opera/9.80
    Opera Phone: N97


    Plz Help.. Thank You
    Last edited by GumSlone; 02.03.11, 16:33.

    #2
    PHP Code:
    <?php 
    if(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']))
    $browser $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
    else
    $browser $_SERVER['HTTP_USER_AGENT'];
    $mobile strtok($browser"/");
    echo 
    $mobile;
    ?>
    or

    PHP Code:
    <?php 
    if(isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']))
    {
    $mobile strtok($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'], "/");
    echo 
    $mobile;
    }
    $mobile strtok($_SERVER['HTTP_USER_AGENT'], "/");
    echo 
    $mobile;
    ?>
    Advertise your mobile site for FREE with AdTwirl

    Comment

    Working...
    X