Function __global->is_mobile

Definitions

sources/global3.php

  • Look at the user's browser, and decide if they are viewing on a mobile device or not.A mobile device can generally be considered a touchscreen device with a screen smaller than a desktop/laptop.There is no perfect delineation.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: bool

Parameters

Name Type Default Set Range Description
$user_agent ?string Null N/A N/A The user agent (null: get from environment, current user's browser)
$include_tablets boolean False N/A N/A Whether to include tablets (which generally would be served the desktop version of a website)
$truth boolean False N/A N/A Whether to always tell the truth (even if the current page does not have mobile support)

Return

  • Whether the user is using a mobile device
  • Type: boolean
  • Set: N/A
  • Range: N/A