Detect Browser

If you need to use a distinct stylesheet for various browsers you need to use HTML conditional tags or you should use this.

<?php add_filter('body_class','browser_body_class'); 
function browser_body_class($classes) { 
 
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; 
 
if($is_lynx) $classes[] = 'lynx'; 
 
elseif($is_gecko) $classes[] = 'gecko'; 
 
elseif($is_opera) $classes[] = 'opera'; 
 
elseif($is_NS4) $classes[] = 'ns4'; 
 
elseif($is_safari) $classes[] = 'safari'; 
 
elseif($is_chrome) $classes[] = 'chrome'; 
 
elseif($is_IE) $classes[] = 'ie'; 
 
else $classes[] = 'unknown'; 
 
if($is_iphone) $classes[] = 'iphone'; 
 
return $classes; 
} ?>

 

Masum Billah has written 326 articles

Hi I am Md. Masum Billah Contributor of this website. I always like to share various things with other. In this website I am sharing web design related tips and tricks, necessary web development tools, source codes for beginner and advance web developer. You may join with us to help other who want to learn web design and development. Thank you for stay with.

Recommended Articles

One thought on “Password Generator PHP Snippet

  1. Haritha says:

    This blog is really informative. I gained more knowledge by reading your post. Thanks for providing us the useful information with us. Your blog is really helpful for me in attaining my knowledge in a right way.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>