CakePHP3: Check if user browsing from iPad

Cake is built in with MobileDetect nowadays, so it is as simple as this:


<?php
use Mobile_Detect;
$mb = new Mobile_Detect;
if($mb->isIpad()){
echo "is ipad";
}else{
echo "is not ipad";
}


There are other handy methods such is isMobile(), isChrome() etc:
http://mobiledetect.net/
#cakephp3

People Who Wowed This Post

×
  • If you are a bloguru member, please login.
    Login
  • If you are not a bloguru member, you may request a free account here:
    Request Account
This user only allows bloguru members to make comments.
If you are a bloguru member, please login.
Login
If you are not a bloguru member, you may request a free account here:
Request Account