Re: How do you handle device detection?

From: Date: Mon, 12 Apr 2004 04:02:36 +0000
Subject: Re: How do you handle device detection?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-183139@lists.php.net to get a copy of this message
Richard, You would do that by looking at the user_agent parameter that is being send by the browser to the server. PHP automatically places the user_agent information in the superglobal: $_SERVER['HTTP_USER_AGENT']. The user_agent string might seems cryptic, therefore PHP provides you a built-in function for representing the user agent information in an object with properties representing the features of the browser. The function is get_browser(). Link to documentation of this function: http://www.php.net/manual/en/function.get-browser.php Good luck, Lukasz Karapuda "Richard Davey" <rich@launchcode.co.uk> wrote in message news:805410340.20040412020254@launchcode.co.uk... > Hi all, > > This is just a general question to get some ideas from the "wider > world" as it were. > > Say you've finished your site. It looks lovely and works perfectly. > You have a CSS file for modern browsers and one that degrades for > text-only devices also. You even have a special "small width" version > for PDAs and the like. > > So how do you go about detecting just what is looking at your site? > How would you handle detecting and then serving the same site for a > standard browser, a screen-reader, a PDA device or a WAP/mobile > device? > > Any tips/suggestions gratefully listened to. > > -- > Best regards, > Richard Davey > http://www.phpcommunity.org/wiki/296.html

« previous php.general (#183139) next »