1

ismobile

is_mobile
SYNOPSIS

is_mobile($agent=false)

DESCRIPTION
CODE
  1. function is_mobile($agent=false) {
  2.     if (!$agent) {
  3.         require_once 'useragent.php';
  4.  
  5.         $agent=user_agent();
  6.     }
  7.  
  8.     return $agent and preg_match('/android|webos|iphone|ipad|ipod|iemobile|blackberry|opera mini/i', $agent);
  9. }
SEE ALSO

useragent

Comments

To add a comment, click here.