PHP Browser Detection

PHP Browser Detection

Wordpress plugin

Install on Wordpress

App Details

Version 3 adds support for is_tablet(), is_desktop(), and is_browser() as well as numerous bug fixes and code improvements. As of version 3.1.2 automatic updates of browscap.ini are disabeld until we can deal with memory usage issues.

PHP Browser Detection is a WordPress plugin used to detect a user’s browser. It can be used to send conditional CSS files for Internet Explorer, display different content or custom messages anywhere on the page, or to swap out Flash for an image for iPhones.

Template Tags:

Test for specific browsers:

$version is optional. Include a major version number, a single integer – 3,4,5, etc… Or leave it empty to test for any version.

<?php if(is_firefox($version)) { /* your code here */ }; ?> <?php if(is_safari($version)) { /* your code here */ }; ?> <?php if(is_chrome($version)) { /* your code here */ }; ?> <?php if(is_opera($version)) { /* your code here */ }; ?> <?php if(is_ie($version)) { /* your code here */ }; ?> <?php if(is_browser($name, $version)) { /* your code here */ }; ?> 

Check for mobile, tablet, iPhone, iPad, iPod, etc…

<?php if(is_desktop()) { /* your code here */ }; ?> <?php if(is_tablet()) { /* your code here */ }; ?> <?php if(is_iphone($version)) { /* your code here */ }; ?> <?php if(is_ipad($version)) { /* your code here */ }; ?> <?php if(is_ipod($version)) { /* your code here */ }; ?> <?php if(is_mobile()) { /* your code here */ }; ?> 

Check for greater than / less than a specific version…

Less than or equal to Firefox 19:
< ?php if(is_firefox() && get_browser_version()

Less than or equal to IE 10:
< ?php if(is_ie() && get_browser_version()

Greater than or equal to Safari 4:
= 4) { /* your code here */ }; ?>

these are just a few examples, but this syntax will work for any browser or version.

Check specific versions…

Is the browser IE6?

Is the browser IE10?

Or you can get all the info and do what you want with it:

Get just the name…

<?php $browser_name = get_browser_name(); ?> 

Get the full version number – 3.2, 5.0, etc…

<?php $browser_version = get_browser_version(); ?> 

Or get it all in array…

<?php $browser_info = php_browser_info(); ?> 

Shortcodes:

Test for specific browsers:

[is_browser name="chrome" version="45"] <p>You are using Chrome 45 or above.</p> [/is_browser] 

Output all browser info:

[browser_info] 

Pricing

Starting from $0 per month.

Check Out the Scratch Card Widget

By Common Ninja

Scratch CardTry For Free!

App Info

Rating

Reviewers

16 reviews

Tags

browser
browser detection
internet explorer
iphone
php

Developed By

Mindshare Labs, Inc.

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Scratch Card for Wordpress logo

Scratch Card

Add an interactive scratch card to engage users, reveal offers, and support lead capture through gamified participation.

Personality Quiz for Wordpress logo

Personality Quiz

Create interactive personality quizzes with custom results and flexible design to boost engagement and help visitors explore tailored outcomes easily.

PayPal Donate Button for Wordpress logo

PayPal Donate Button

Make it easy for supporters to contribute using PayPal or Stripe by adding a donation button that keeps giving fast, secure, and on site.

Vimeo Carousel for Wordpress logo

Vimeo Carousel

Show Vimeo videos with a Vimeo carousel that displays clips in a smooth, flexible layout to boost visibility and engagement.

Social Media Links for Wordpress logo

Social Media Links

Use social media links with sticky buttons that keep your profiles visible, boost engagement, and help promote your content more effectively across your site.

Marketing Button for Wordpress logo

Marketing Button

Marketing button with text and an icon that highlights key offers, draws attention to promotions, and helps increase engagement and conversions.

Scroll Progress for Wordpress logo

Scroll Progress

Use a scroll progress bar that visually tracks reading on the page, improves navigation, and keeps visitors aware of their position.

Corner Pop-up for Wordpress logo

Corner Pop-up

Add a floating corner pop-up to display updates or calls to action without disrupting the user experience or site flow.

Mastodon Feed for Wordpress logo

Mastodon Feed

Show Mastodon posts in a live Mastodon feed that keeps content fresh, strengthens your social presence, and helps visitors engage with your updates.

Twitch Feed for Wordpress logo

Twitch Feed

Show live streams and clips with a Twitch feed that keeps content fresh, boosts engagement, and helps visitors follow your channel more easily.

Slideshow for Wordpress logo

Slideshow

Present images in a Slideshow carousel that rotates or slides through visuals, helping you highlight key content within a clean, engaging layout.

Linkedin Feed for Wordpress logo

Linkedin Feed

Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms