As strange as I find this, I have not been able to find a good PHP function anywhere which will do an intelligent parse of a user agent string? Googled it for about 20 minut
There is a PHP class library i found out, and it has worked so well for me. It is in the link below.
https://www.toms-world.org/blog/parseuseragentstring
It is lightweight and just does what I wanted (Browser, Version, OS, Mobile/PC, and much more) in a memory-friendy manner.