Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Mobile detector in PHP

<?php
function isMobileDevice() {
    return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo
|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up.browser|up.link|webos|wos)/i"
, $_SERVER["HTTP_USER_AGENT"]);
}
if(isMobileDevice()){
    echo "Mobile Browser Detected";
}
else {
    echo "Mobile Browser Not Detected";
}
?>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Mobile #detector #PHP
ADD COMMENT
Topic
Name
4+9 =