if not on iPhone


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
  3. $ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
  4. $android = (bool) strpos($_SERVER['HTTP_USER_AGENT'],"Android");
  5. $webos = (bool) strpos($_SERVER['HTTP_USER_AGENT'],"WebOS");
  6. ?>
  7.  
  8. <?php if ( !$iphone && !$android && $webos ) { ?>
  9.  
  10. ///// if not on ipad
  11.  
  12. <?php $ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad'); if ( !$ipad ) { ?>
  13. /*CONTENT*/
  14. <?php } ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.