Skip to content

REQ_MOB

Jurek Muszyński edited this page Dec 20, 2021 · 5 revisions

bool REQ_MOB

Description

Answers whether request comes from mobile user agent. Mutually exclusive with REQ_DSK and REQ_TAB.

Returns

Returns true if request is from mobile, otherwise false.

Example

// serve different CSS, depending on user agent
OUT("<link rel=\"stylesheet\" type=\"text/css\" href=\"%s.css\">", REQ_MOB?"mob":"dsk");

if ( REQ_MOB )
    OUT("<meta name=\"viewport\" content=\"width=device-width\">");
Clone this wiki locally