Closed alexherdea closed 1 year ago
A tablet is also a mobile device. So $detect->isMobile() should work for what you are trying to obtain.
To target only phones do this instead: $detect->isMobile() && !$detect->isTablet()
Ok, thanks for the answer! I thought that ismobile si only for mobile phones. My bad!
Hi,
I am having an issue with MobileDetect. I would like to use it like this: if($detect->isMobile() OR $detect->isTablet() ) {}
so basicaly, i need to show something only for mobiles or tablets. Unfortunately, those togheter don't work, they work ok only separate. Is there a way the i can combine those two into one script?
Thanks
Ro: Salut, incerc sa afisez o functie doar pentru mobile sau tablete, insa scriptul pare sa nu stie sa excluda desktop. Insa, daca folosesc separat If mobile si separat If tablet, se descurca exact cum trebuie. Se pot combina cele doua intr-un singur script? Multumesc frumos