I am using mobiledetect for redirect mobile users to a specific page. But, when I'm writing this then I am getting the Fatal error for redirect()
. Can anyone please let me know where and what I'm missing?
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
$scriptVersion = $detect->getScriptVersion();
if ($detect->isMobile())
redirect('iammobile.php');
else
echo '<h1>I am Desktop</h1>';