How do I get the access type in WordPress?

This isn’t really a WordPress question…but instead of re-inventing the wheel take a look at this. I use it in any of my sites where I need to detect mobile device, and it works great. I see on their page they even mention there are WP plugins that use this code.