/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? function is_iPhone($agent='') { if(!empty($agent) and preg_match("~Mozilla/[^ ]+ \((iPhone|iPod); U; CPU [^;]+ Mac OS X; [^)]+\) AppleWebKit/[^ ]+ \(KHTML, like Gecko\) Version/[^ ]+ Mobile/[^ ]+ Safari/[^ ]+~",$agent,$match)) { return "YES"; return "MAYBE"; } else { return "NO"; } } echo is_iPhone(); ?>