How To Detect Browser Type With Php
Posted On Wed Mar 19, 2008 By hostman In PHP Forums And Topics Discussions About Hyper Text Programming Language Forums
YOUR BROWSER TYPE IS:
CCBot/2.0
to find out what browser your visitors are using when they visit your website, you can find out which one they are using by this php function:
$_SERVER['HTTP_USER_AGENT']
easy right.. hope this helps. please leave your comments if this is what you were looking for
karan Fri Feb 24, 2012
it`s not work
sumit Sun Jan 30, 2011
is that any one tell me how to create browser side session
plz reply.......
askinter
plz reply.......
askinter
Amit Tue Jan 11, 2011
thanks...this is what i m looking for
Merak Fri Jan 07, 2011
<?php
$browser = ' '.addslashes(strtolower($ (strpos($browser, 'safari/')) {
// chrome or safari
if (strpos($browser, 'chrome/')) {
$browsername = 'Chrome';
} else {
$browsername = 'Safari';
}
} else {
//is internet explorer or firefox
if (strpos($browser, 'compatible; msie ')) {
$browsername='Internet Explorer';
}
if (strpos($browser, 'firefox/')) {
$browsername='Firefox';
(strpos($browser, 'opera/')) {
$browsername='Opera';
}
$browsername;
?>
$browser = ' '.addslashes(strtolower($ (strpos($browser, 'safari/')) {
// chrome or safari
if (strpos($browser, 'chrome/')) {
$browsername = 'Chrome';
} else {
$browsername = 'Safari';
}
} else {
//is internet explorer or firefox
if (strpos($browser, 'compatible; msie ')) {
$browsername='Internet Explorer';
}
if (strpos($browser, 'firefox/')) {
$browsername='Firefox';
(strpos($browser, 'opera/')) {
$browsername='Opera';
}
$browsername;
?>
marcos Mon Sep 13, 2010
hey why does it say i am using firefox when i am on ie
prant Tue Apr 13, 2010
cool! Is wat lookin 4!
:):)
:):)
chaitanya Tue Dec 22, 2009
u can use the one from here
chrisschuld /projects/browser-php-detecting-a-u
chrisschuld /projects/browser-php-detecting-a-u
Govind Thu Dec 10, 2009
thanks....
Danny Wed Oct 28, 2009
it doesnt work, i am on ie and it shows mozilla..
Abeon Mon Feb 23, 2009
you could also use something like this:
<pre><?php
echo ( browser_detection( 'number' ) .'<br>'.
browser_detection( 'browser' ) .'<br>'.
browser_detection( 'os' ) .'<br>'.
browser_detection( 'os_number' ) );
?>
outputs (browser version, browser, os, os number):
y.4
moz
nt
4.y ( ( browser_detection( 'browser' ) == 'ie' )
&&
( browser_detection( 'number' ) >= 4 ) )
{
echo 'it is internet explorer ' .
browser_detection( 'number' );
// or anything else you want to happen of course
}
?>
</pre>
<pre><?php
echo ( browser_detection( 'number' ) .'<br>'.
browser_detection( 'browser' ) .'<br>'.
browser_detection( 'os' ) .'<br>'.
browser_detection( 'os_number' ) );
?>
outputs (browser version, browser, os, os number):
y.4
moz
nt
4.y ( ( browser_detection( 'browser' ) == 'ie' )
&&
( browser_detection( 'number' ) >= 4 ) )
{
echo 'it is internet explorer ' .
browser_detection( 'number' );
// or anything else you want to happen of course
}
?>
</pre>
Chris Mon Dec 01, 2008
agreed, it is easy! however, getting a more granular answer is the not-so-easy part. here is my solution to browser detection in php if you are interested: chrisschuld /projects/browser-php-detecting-a-u
Ron Tue Nov 04, 2008
here is a complete solution: chrisschuld /projects/browser-php-detecting-a-u
Swanky Tue Aug 19, 2008
thanks... you made my day... :)
Uko Fri Jun 15, 2012
browscap seems to be more accurate as compared to user_agent. I found a class here on this site which seems promising to me.
Kevin Tue Dec 18, 2012
Using the user agent to detect browser always gives confusing results - everyone on this thread is complaining that the user agent says "Mozilla" because EVERY user agent string says Mozilla. Use php's get_browser or modify the UA string a lot...
Related Content
Information
Forums »
PHP Forums And Topics Discussions About Hyper Text Programming Language »
How To Detect Browser Type With Php
PHP Forums And Topics Discussions About Hyper Text Programming Language »
How To Detect Browser Type With Php
Title: How To Detect Browser Type With Php
Description: How To Detect Browser Type With Php
Tags: how ,to ,detect ,browser ,type ,with ,php
Info: This Post Has Been Viewed 0 Times Since
Date: Wed Mar 19, 2008
Author hostman Received 15 Replies #1134
Date: Wed Mar 19, 2008
Author hostman Received 15 Replies #1134
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Sat May 18, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Sat May 18, 2013 (-8 GMT)
Powered by: Webune Forums V5