Skip to content
Advertisement

Get Specific Device Information

Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else’s?

The only solution I have so far is to use $_SERVER[‘REMOTE_PORT’ in conjunction with $_SERVER[‘HTTP_USER_AGENT’], to verify iPhone, but that doesn’t ensure a specific iPhone..

Advertisement

Answer

There is a really simple solution to use Mobile-detect here: https://github.com/serbanghita/Mobile-Detect/

Enjoy!

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement