I am looking for a simple way to check if the user is on a android mobile divice or if its on a apple(IOS) divice so I can display the website for them. I found some solutions but I wanna know if there is a simple if/else statement to check that.
Asked
Active
Viewed 1,024 times
0
-
$_SERVER, maybe – popeye Apr 11 '18 at 08:12
-
Simple Solution :-> just pass **`use_type=android/IOS`** parameter while calling api and disaplay result based on that – AskNilesh Apr 11 '18 at 08:13
-
Posible duplication of:(https://stackoverflow.com/questions/6322112/check-if-php-page-is-accessed-from-an-ios-device) – Sylent Apr 11 '18 at 08:13
-
4Possible duplicate of [Check if PHP-page is accessed from an iOS device](https://stackoverflow.com/questions/6322112/check-if-php-page-is-accessed-from-an-ios-device) – Sylent Apr 11 '18 at 08:14
1 Answers
0
I use this package:
https://github.com/hisorange/browser-detect
Install:
composer require hisorange/browser-detect
Some functions you might use:
1) Browser::platformFamily()
// iOS
2) Browser::browserFamily()
// Chrome Mobile iOS
3) $browser = Browser::detect();
// Get all details about the visitor's device:

Ralph John Galindo
- 1,190
- 6
- 11