Mobile Device Detection for CodeIgniter
by James Constable
This is a lightweight mobile device detection algorithm for CodeIgniter.
You can either use http://getsparks.org to install via the spark installer. Visit http://getsparks.org/packages/mobiledetection/versions/HEAD/show to install it.
- Extract the archive you get from here.
- Put libraries/mobiledetection.php into your applications libraries diectory.
If you've installed via the spark then add the following to your controller.
if you've installed manually.
From there on call the following function to determine if your visitor is using a mobile device.
True is returned if they are, otherwise false is returned.