In: Computer Science
Why would a web developer need to know what browser a user is using? How does PHP play a role in browser indentification?
A web developer needs to know which browser a user is using because, newer browsers have the capability to support cutting-edge(Rich grpahic user interface) web elements(HTML, CSS elements) which the older browsers are not capable.of.So , the developer develops his website in such a way that the the newer browsers should be able to display the cutting-edge elements and the older browsers should just ignore the cutting -edge elements and just display the basic version of the website.Due to this reason a web developer would need to know which browser a user is using and accordingly display the website.
PHP has a function named get_browser() which returns the capabilities of the user's browser. Hence, PHP can be used for browser identification.