Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Function get_browser() -> Zero Fill
Old 05-04-2004, 05:05 PM Function get_browser() -> Zero Fill
Mr Zylinder's Avatar
Junior Talker

Posts: 2
Location: Austria, Vienna
Trades: 0
the problem: (using: PHP Version 4.2.1)

the function get_browser fills $b with a Zero value.
I´ve loaded a brand new browscap.ini file on my system
and tested it with phpinfo(). Everything seems quite ok
but the code below just returns

$str = 0:

array-key + string':'

Tx 4 help

- Code -----------------------------------------------
function list_array ($array) {
while (list ($key, $value) = each ($array)) {
$str .= "$key: $value";
$str .= "<br>";
}
return $str;
}

$b = get_browser();
if(!empty($b))
echo list_array ((array) $b);
- Output ---------------------------------------------

0:
Mr Zylinder is offline
Reply With Quote
View Public Profile Visit Mr Zylinder's homepage!
 
 
Register now for full access!
Old 05-04-2004, 05:26 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
What happens if you print_r( (array)$b ); ? Is it the same output as your list_array() function? Looks as if it should work to me... $b is an object, casting it to an array to print it should work, your list_array() should work... If print_r shows the same results then I guess it has to do with get_browser() and your machine.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE


Last edited by Christopher; 05-04-2004 at 05:29 PM..
Christopher is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Function get_browser() -> Zero Fill
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11854 seconds with 12 queries