PHP function to check proper user agent for mobile / tablet devices (server-side method)