problem with get_browser()
Posted: Fri Mar 14, 2003 11:55 am
Hello!
I suppose the function get_browser() doesn't work correctly.
The following example (out of the PHP documentation) delivers no valid result:
<?php
function list_array ($array) {
while (list ($key, $value) = each ($array)) {
$str .= "<b>$key:</b> $value<br>\n";
}
return $str;
}
echo "$HTTP_USER_AGENT<hr>\n";
$browser = get_browser();
echo list_array ((array) $browser);
?>
Just as the first example, this one doesnt' work either:
<?
$ua = get_browser ();
echo "Browser: $ua->browser";
?>
It would be very nice if someone told me what I'm doing wrong!
(PHP Version: 4.2.2)
greets
Jens
I suppose the function get_browser() doesn't work correctly.
The following example (out of the PHP documentation) delivers no valid result:
<?php
function list_array ($array) {
while (list ($key, $value) = each ($array)) {
$str .= "<b>$key:</b> $value<br>\n";
}
return $str;
}
echo "$HTTP_USER_AGENT<hr>\n";
$browser = get_browser();
echo list_array ((array) $browser);
?>
Just as the first example, this one doesnt' work either:
<?
$ua = get_browser ();
echo "Browser: $ua->browser";
?>
It would be very nice if someone told me what I'm doing wrong!
(PHP Version: 4.2.2)
greets
Jens