Mobile_Detect.php and Drupal
I wrote a module to do just that, Mobile Detect:


  This is a lightweight mobile detection based on the Mobile_Detect.php
  library, which can be obtained from the GitHub repository.
  
  This module is intended to aid developers utilizing mobile-first and
  responsive design techniques who also have a need for slight changes
  for mobile and tablet users. An example would be showing (or hiding) a
  block or content pane to a particular device.
  
  This module is not intended (and never will be enhanced) to provide
  theme switching or redirection; other modules already provide this
  functionality.


There is also Context Mobile Detect:


  This is a Context module which integrates Context and PHP Mobile
  Detect library Mobile_Detect.
  
  Module preserve drupal page cache working.


And you can check out Mobile Switch:


  The Mobile Switch module provides a simple automatic theme switch
  functionality for mobile devices, detected by Browscap or Mobile
  Detect.


These all serve slightly different audiences.  Pick the one that best fits your needs.