$HTTP_USER_AGENT problem. Help me!

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

    $HTTP_USER_AGENT problem. Help me!

    $HTTP_USER_AGENT showing full information of the device, but I want to show only the device name. (e.g. Opera, SonyEricsson C510, N97,..etc). Plz help me
    Here is my site
    Last edited by Rocky01; 23.05.10, 02:55.

    #2
    Here is an exemple:

    Code:
    $
    MY_USER_AGENT = explode("/", $_SERVER["HTTP_USER_AGENT"]);
    $
    MY_USER_AGENT = $
    MY_USER_AGENT[0];
    
    // Now lets show the result
    echo $MY_USER_AGENT;

    Comment


      #3
      PHP Code:
      <?php echo $_SERVER["HTTP_USER_AGENT"]; ?>
      Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

      Comment


        #4
        Originally posted by RafaelWBR View Post
        Here is an exemple:

        Code:
        $
        MY_USER_AGENT = explode("/", $_SERVER["HTTP_USER_AGENT"]);
        $
        MY_USER_AGENT = $
        MY_USER_AGENT[0];
        
        // Now lets show the result
        echo $MY_USER_AGENT;
        Thanx bro its working. Thanx again

        Comment


          #5
          Crap sorry you wanted the name only?
          for the name only use
          PHP Code:
           <?php $name explode("/",$_SERVER["HTTP_USER_AGENT"]); echo $name[0]; ?>
          Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

          Comment

          Working...
          X