I am trying to detect the device using this script http://mobiledetect.net/
but it's not detecting iPhone.
header.php:
<?php
require_once 'include/Mobile_Detect.php';
$detect = new Mobile_Detect; ?>
device.php:
<?php include 'include/header.php'; ?>
<?php if( $detect->isMobile() && $detect->isTablet() ){ ?>
<script type='text/javascript'>
alert("I am mobile");
</script>
<?php } else { ?>
<script type='text/javascript'>
alert("I am desktop");
</script>
<? } ?>
When I check the page on desktop I am getting popup with this message: I am desktop
- As I expected
When I check the page on android tablet I am getting popup with this message: I am mobile
- As I expected
When I check the page on iPhone I am getting popup with this message: I am desktop
- NOT as expected.
Why is this?
Here is the PAGE