Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use get_browser() Function in php ?
The get_browser() function returns the capabilities of the user's browser.
It looks up the user's browscap.ini file.
syntax of get_browser()
get_browser(user_agent,return_array)
The above syntax user_agent,return_array both parameter are optional.
you can see bellow example:
<?php
//here call user_agent
echo $_SERVER['HTTP_USER_AGENT'];
$get_browser = get_browser();
//print the $get_browser
print_r($get_browser);
?>
The above example will output something:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
0 Comment(s)