<?
/*current browser*/
$string = get_browser("name");
echo("$string");
?>
is giving me the error:
Catchable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\endlessdescription\header.php on line 106
line 106 is echo("$string"). I have a similar bit of code that displays the last modified date/time above and it works fine.
I pulled this from a book so I don’t see why it wouldn’t work, is “name” not a valid argument of get_browser? Any help greatly appreciated.
As you can read here, from the official documentation, the function
get_browserreturn an array, not just a string. So you have to choose the info you need and print it accordingly.Maybe the best info that fits your need is to echo the value of
browser.