Support » Plugin: PHP Browser Detection » How do I set the same property for several browsers?

  • Resolved cbarnett

    (@cbarnett)


    Hi, Firstly, Great plugin!
    Sorry, this answer is probably obvious but I’m not sure how to check for multiple browser types and apply the same PHP to them, then if they aren’t those particular browsers, to do something else.

    Currently I am just searching for IE, but I also want it to check for Chrome. My code for IE checking is below in one of my page template php files:

    if ( is_IE($version) ) {
    moover(22);
    }
    else {
    moover (16);
    }

    So where would I put “is chrome” code into the lines?

    Thanks for your help in advance.

    http://wordpress.org/extend/plugins/php-browser-detection/

Viewing 3 replies - 1 through 3 (of 3 total)
  • And just a note those are codes for slideshows – I want it to play one slide show for some browsers (without animated GIFs because IE and Chrome both have trouble playing them) and another slideshow for all other browsers (with animated GIFs).

    Thanks.

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    You could something like this:

    if(is_IE($version)) {
        moover(22);
    elseif(is_chrome($version)) {
        moover(18);
    } else {
        moover(16);
    }

    Make sense?

    Yes – that worked perfectly! Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I set the same property for several browsers?’ is closed to new replies.