Detect iPhone function


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

Detect if the user is browsing from and iPhone (or iPod) to server up specific content. For example, iPhone users can receive youtube video content instead of vimeo, etc.


Copy this code and paste it in your HTML
  1. function isiphone() {
  2. return (stripos(strtolower($_SERVER['HTTP_USER_AGENT']),"iphone") > -1) ? true : false;
  3. }

Report this snippet


Comments


You need to login to view comments.