2

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,

Danny Fox
  • 38,659
  • 28
  • 68
  • 94

3 Answers3

10

The user agent contains "Dolfin/2.0".

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
2

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.

James
  • 5,137
  • 5
  • 40
  • 80
markashworth
  • 1,141
  • 10
  • 17
  • It also makes sense to check other data than user agent, I've got `$_SERVER['HTTP_X_REQUESTED_WITH']` with `com.dolphin.browser.zero` in my Dolphin Zero (via ajax). – optimizitor Mar 01 '17 at 14:38
-6

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.
Sorin Buturugeanu
  • 1,782
  • 4
  • 19
  • 32
  • 5
    Why is this answer marked as correct when Dolphin user-agent string doesn't contain string Dolphin? – jayarjo Sep 28 '12 at 13:44
  • 1
    They use "dolfin" not "dolphin" in the UA string. Who knows why. But anyways as @jayarjo says, this "correct" answer is not correct. – Sean Nov 20 '12 at 01:15