is_browser([$key = NULL])
Parameters: |
|
---|---|
Returns: |
TRUE if the user agent is a (specified) browser, FALSE if not |
Return type: |
bool |
Returns TRUE/FALSE (boolean) if the user agent is a known web browser.
1 2 3 4 5 6 7 8 | if ( $this ->agent->is_browser( 'Safari' )) { echo 'You are using Safari.' ; } elseif ( $this ->agent->is_browser()) { echo 'You are using a browser.' ; } |
Note
The string “Safari” in this example is an array key in the list of browser definitions. You can find this list in application/config/user_agents.php if you want to add new browsers or change the stings.
Please login to continue.