code: public static function getUserPlatform()
      {
          $user_agent = $_SERVER['HTTP_USER_AGENT'];
          $user_platform = 'unknown';
  
          if (false !== stripos($user_agent, 'linux')) {
              $user_platform = 'Linux';
          } elseif (preg_match('/macintosh|mac os x/i', $user_agent)) {
              $user_platform = 'Mac';
          } elseif (preg_match('/windows|win32/i', $user_agent)) {
              $user_platform = 'Windows';
          }
  
          return $user_platform;
      }
docs: Get user OS
  
  @return string User OS
  @static