Skip to content

Instantly share code, notes, and snippets.

@thomasjpr
Created March 6, 2014 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasjpr/9392769 to your computer and use it in GitHub Desktop.
Save thomasjpr/9392769 to your computer and use it in GitHub Desktop.
PHP regex to detect mobile browsers
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment