Posted By

ryarwood on 06/16/11


Tagged

php detection iphone iPad


Versions (?)

Detect Apple iPhone or iPad if Statement


 / Published in: PHP
 

Detects iPhone or iPad or both and either hides something or does something special based on it.

  1. <?php
  2. if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad')) {
  3. echo('<style type="text/css">#furnishButton { display: none; }</style>');
  4. }
  5. ?>

Report this snippet  

You need to login to post a comment.