MobileDetect PHP
Github4.8.x3.74.x2.8.xDemo
  • Introduction
  • Install
  • How to use (composer)
  • How to use (standalone)
  • The constructor
  • Example
  • Other versions
  • Demo
  • Performance
  • Contribute
  • Developing code
  • Project structure
  • Extending / Porting
  • Add new module, plugin or port
  • Plugins, Modules and Ports
  • Credits
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

Extending / Porting

Learn how to create a port of Mobile Detect in a different language or library.

PreviousProject structureNextAdd new module, plugin or port

Last updated 5 months ago

Was this helpful?

Open

It contains all the information necessary to create a "mobile" detection script in any programming language. You can auto-import this periodically in your repository by checking the version property, which is updated on each release.

The following fields will help you create a Mobile Detect script in the language of your choice.

{
    // Current released version. Respects semver.
    "version": "x.x.x",
    // Specific HTTP headers that attest for a "mobile" device.
    "headerMatch": { ... },
    // Array with HTTP header names that can potentially contain the "User-Agent" string.
    "uaHttpHeaders": [ ... ],
    // Amazon CloudFront headers.
    "cloudFrontHttpHeaders": [ ... ],
    // Regexes ordered by priority of "mobile" devices.
    "uaMatch": {
       "phones": { ... },
       "tablets": { ... },
       "browsers": { ... },
       "os": { ... }
    }

If you believe you need more fields or values, please .

https://github.com/serbanghita/Mobile-Detect/blob/4.8.x/MobileDetect.json
open a Github issue