Danny Fox
Danny Fox

Reputation: 40799

How to detect dolphin browser in php?

How to detect dolphin browser in php? Unfortunatly I don't have android, so I can't check the dolphin browser's user agent.

thanks in advance,

Upvotes: 2

Views: 2646

Answers (3)

markashworth
markashworth

Reputation: 1169

On my version of Dolphin, 8.8.2 - running on a Samsung Galaxy Note, there is no particular user agent and 'desktop' is set. The user-agent is set by tapping on More -> Settings -> User Agent. I am then able to change the user agent to any of the following:

  • Android
  • Desktop, which identifies as: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16
  • iPhone
  • iPad
  • Custom (I guess you could set a custom user-agent such as 'dolfin' if you want).

So if you're trying to deliver content specific to the Dolphin browser in PHP you could test if 'mobi' or 'Android' is present in the user agent. If you're trying to detect that the exact browser being used is Dolphin then that will be tricky unless your client device's custom user-agent is set.

Upvotes: 2

Sorin Buturugeanu
Sorin Buturugeanu

Reputation: 1840

You can check the User Agent

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'dolphin') !== false) {
    echo 'Your UA is Dolphin';
}
  • You can do a more accurate check if you know the exact User Agent, but I assumed that if it contains the word dolphin is accurate enough.

Upvotes: -6

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799520

The user agent contains "Dolfin/2.0".

Upvotes: 10

Related Questions