Built From Developers For Developers
» Kuikie.com » Snippets » PHP » Other » PHP. Find if Visitor's Browser is iPone
  Categories
  PHP
    Arrays
    Date & Time
    Files & Directories
    Globalization
    Images
    OOP
    Other
    Strings
    User Interface
 

PHP. Find if Visitor's Browser is iPone

This one line PHP snippet allows you to fond out if the visitor is using iPhone to browse your website.

$is_browser_iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone")?true:false;

Exmple:

if ($is_broser_iphone) {
    // Output icon for iPhone (must be 57x57 pixels)
    echo '';

    // Output meta for iPhone
    echo '';
    
    // Output stylesheet for iPhone
    echo '';
}
 
©2012 Sinevia Ltd Terms of Use         Privacy Policy Valid XHTML 1.0 Transitional