Posted By

cerxx on 12/21/18


Tagged

opencart adaptive check-device php-hacks


Versions (?)

Detecting mobile devices on PHP for Opencart


 / Published in: PHP
 

URL: https://github.com/serbanghita/Mobile-Detect

Detecting mobile devices on PHP for Opencart

  1. // ==== https://github.com/serbanghita/Mobile-Detect ====
  2. // Mobile_Detect.php file should be renamed to lowercase (mobile_detect.php) and put in the / system / library / directory
  3. // Underlying code must add to the end of file startup.php
  4. // Detect Mobile
  5. $detect = new mobile_detect;
  6. $phone = ($detect->isMobile() && !$detect->isTablet()) ? true : false ;
  7. $tablet = ($detect->isTablet()) ? true : false ;
  8. define('PHONE', $phone);
  9. define('TABLET', $tablet);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Mccauleyray on December 27, 2018

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution. This article might help you out.

Posted By: ninatorres on December 31, 2018

PHP stands for PHP HyperText PreProcess. It’s a returning acronym that is a programmer’s trick. Meaning that no theme how many times you explain the small form it will loop for eternity. PHP is used for making websites lively. HTML and CSS only give arrangement and style. PHP is a server surface language, meaning it is not appreciate by the browser. PHP can tell you the time, interpret information, do math, and join to databases and more. It’s an open source language sense you don't require a license to develop with it. It has the aptitude to generate HTML, loop over part of content based on conditions. And ask the computer questions and like programming functions.

You might require detect a mobile device on a PHP base website in the project. You may see a lot of websites having a desktop side. And also an essential mobile version of the similar website to make it simpler for mobile internet users. But to do it you have to have to notice a mobile device. Notice a mobile device from the server surface is the best as it will not load needless content and in reality make a website faster through loading only the content that you wish for to show on mobile device. While you can use CSS media query, it will not avoid mobile devices from loading content that you want only for computers or desktop. So the best method of detecting a mobile service from the server side. You be able to do it using PHP. In this portion, I am going to show you an easy PHP code snippet which will with no barrier sort if the visitors on your site are by a mobile device.PHP is a fast developer language much valued about the world; it is lap up by developers who are working about fused problems. With pace being the serious piece, it uses much method resources. This allows the PHP developers to work fast and get the work done in less time.

You need to login to post a comment.