NYCPHP Meetup

NYPHP.org

[nycphp-talk] Parse error setting an array - why?

soazine@pop.erols.com soazine at pop.mail.rcn.net
Fri May 30 11:53:33 EDT 2003


Ok I will do the best I can, although it won't make the problem clearer (at
least to me):

Warning: Invalid argument supplied for foreach() in
/users/ppowell/web/profile/display.php on line 92

Line 92: 
foreach ($browser as $key => $val) 
     echo "$key = $val<br>";

Furthermore I do not understand

$browserArray = array($key, $val);

I have never seen that before, and honestly, I come from the TCL background
of this: [set $browserArray($key) $val] -> this is why I associate an array
element setting that way.  

Bottom Line: I am trying to detect if the user is using Javascript from a
server-side perspective.

Phil

Original Message:
-----------------
From: Analysis & Solutions danielc at analysisandsolutions.com
Date: Fri, 30 May 2003 11:48:08 -0400
To: talk at nyphp.org
Subject: Re: [nycphp-talk] Parse error setting an array - why?


Phil:

On Fri, May 30, 2003 at 10:58:48AM -0400, soazine at pop.erols.com wrote:
>
>     $browserArray($key) = $val;

That looks weird to me for several reasons.  Perhaps you mean:

   $browser = array($key => $val);

In general, in the future, copy and paste the error message, including the 
file and line, then tell us which line numbers of the script you're 
showing us (and make sure to import the exact script to your email, not a 
retyping of it, which it looks like you may have done here.

--Dan

-- 
     FREE scripts that make web and database programming easier
           http://www.analysisandsolutions.com/software/
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7th Ave #4AJ, Brooklyn NY    v: 718-854-0335   f: 718-854-0409


--- Unsubscribe at http://nyphp.org/list/ ---



--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .






More information about the talk mailing list