Mobile_Detect __construct(
)
|
|
Redefined in descendants as:
boolean checkHttpHeadersForMobile(
)
|
|
Check the HTTP headers for signs of mobile.
This is the fastest mobile check possible; it's used inside isMobile() method.
API Tags:
void getOperatingSystems(
)
|
|
API Tags:
Get the properties array.
Get the current script version.
This is useful for the demo.php file, so people can check on what version they are testing for mobile devices.
API Tags:
bool|int|null is(
$key
$key, [string
$userAgent = null], [string
$httpHeaders = null]
)
|
|
This method checks for a certain property in the userAgent.
Parameters:
string |
$userAgent: |
deprecated |
string |
$httpHeaders: |
deprecated |
$key |
$key: |
|
API Tags:
bool isMobile(
[null
$userAgent = null], [null
$httpHeaders = null]
)
|
|
Check if the device is mobile.
Returns true if any type of mobile device detected, including special ones
Parameters:
null |
$userAgent: |
deprecated |
null |
$httpHeaders: |
deprecated |
API Tags:
Redefined in descendants as:
bool isTablet(
[null
$userAgent = null], [null
$httpHeaders = null]
)
|
|
Check if the device is a tablet.
Return true if any type of tablet device is detected.
Parameters:
null |
$userAgent: |
deprecated |
null |
$httpHeaders: |
deprecated |
API Tags:
Redefined in descendants as:
bool match(
$regex
$regex, [string
$userAgent = null]
)
|
|
Some detection rules are relative (not standard), because of the diversity of devices, vendors and their conventions in representing the User-Agent or the HTTP headers.
This method will be used to check custom regexes against the User-Agent string.
Parameters:
string |
$userAgent: |
|
$regex |
$regex: |
|
int prepareVersionNo(
$ver
$ver
)
|
|
Prepare the version number.
Parameters:
void setDetectionType(
[
$type = null]
)
|
|
Parameters:
void setHttpHeaders(
[
$httpHeaders = null]
)
|
|
Parameters:
API Tags:
void setMobileDetectionRules(
)
|
|
Method sets the mobile detection rules.
This method is used for the magic methods $detect->is*()
API Tags:
bool setMobileDetectionRulesExtended(
)
|
|
Method sets the mobile detection rules + utilities.
The reason this is separate is because utilities rules don't necessary imply mobile.
This method is used inside the new $detect->is('stuff') method.
API Tags:
void setUserAgent(
[
$userAgent = null]
)
|
|
Parameters:
API Tags:
mixed version(
string
$propertyName, [
$type = 'text']
)
|
|
Check the version of the given property in the User-Agent.
Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
Parameters:
string |
$propertyName: |
|
|
$type: |
|
mixed __call(
string
$name, array
$arguments
)
|
|
Magic overloading method.
Parameters:
string |
$name: |
|
array |
$arguments: |
|
API Tags: