So I tried this function but my hosting server show me this error: browscap ini directive not set.
Looking on php.net I found that it works “by looking up the browser’s information in the browscap.ini file.”. Because it’s not my server I can’t do nothing, so I wrote to my hosting support and they gave me an alternative solution: phpbrowscap.
Just follow the QuickStart guide to set up the script and make it works.
If you need get_browser() function but you have server problem use this workaround.