Friday, January 8, 2016

How to get full detail of user's system in php?

Get full detail of user's system in php:

For getting full detail of any user's system (including browser, os etc) we have to use this function.



    public function getDeviceDetail()
    {
        $user = new UserController();
        $user_agent = $_SERVER['HTTP_USER_AGENT'];
        $os_platform = array();
        $os_array = $user->deviceList();
        foreach ($os_array as $regex => $value) {
            if (preg_match($regex, $user_agent)) {
                $os_platform[] = $regex;
            }
        }
        return $os_platform;
    }




Using this function we will get all the details of any user.

Thanks

No comments:

Post a Comment