Home » Tip of the day » Detecting mobile devices (server side)
Reply to comment
Avinash
Written on:16 April 2012
Hi .. Your script is really interesting.I'am testing it to shows no ads for mobile users by detecting them using the isMobile(), but the Question I have I'am having to use
<?php include('Mobile_Detect.php'); $detect = new Mobile_Detect();
if ($detect->isMobile()) { } else { }
?>
for every ad slot.
So can the result be stored as a global variable eliminating the need for including the script multiple times for the same result ?? If yes can you let me know how.
Thanks.
<?php
include('Mobile_Detect.php');
$detect = new Mobile_Detect();
if ($detect->isMobile()) { } else { }
?>