There are several reasons why you may not want to rely on PHP to detect the browser. Some of them are summarized here
]. In my opinion, it depends on your purpose and your target.
Walt has been playing with software since around 1967 and has generated more runtime errors than the average village idiot. He is a CEO, Petroleum Engineer, software consultant, janitor, and now a graduate student again. Rather than sleep, he also plays with algorithms and systems for technical computing, develops software for engineering evaluations and is an avid amateur radio operator.
Walt was admitted back to UT Austin and is actually attempting to complete a PhD in engineering, thereby proving that he is crazier than the average old fart.
And now UT has gone and admitted Walt to PhD candidacy, proving that old guys can still ... what was he doing again?