In a website, how to detect device => model name of mobile
when using mobile ? How to ideas
Use:
$_SERVER['HTTP_USER_AGENT'];
You can read more about $_SERVER calls here
Although you can directly use the $_SERVER
variable, there is a small PHP library called Mobile_Detect.php
that makes your files very clean.
I think it runs through the $_SERVER
variable, anyways, but it looks nicer to just call is_iPhone()
than to parse through the header and possibly miss something.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With