NYCPHP Meetup

NYPHP.org

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

Malcolm, Gary gmalcolm at professionalcredit.com
Fri May 30 12:04:23 EDT 2003


from the manual...

<?php
echo $_SERVER['HTTP_USER_AGENT'] . "<hr />\
";

$browser = get_browser();

foreach ($browser as $name => $value) {
    print "<b>$name</b> $value <br />\
";
}

?>

> -----Original Message-----
> From: soazine at pop.erols.com [mailto:soazine at pop.mail.rcn.net]
> Sent: Friday, 30 May, 2003 8:56 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Parse error setting an array - why?
> 
> 
> Warning: Invalid argument supplied for foreach() in
> /users/ppowell/web/profile/display.php on line 8
> 
> Lines 5-9:
> // DETERMINE IF THE USER'S BROWSER HAS JAVASCRIPT BY REARRANGING THE
> get_browser() OBJECT AS AN ARRAY
>    $browser = get_browser();
>    foreach ($browser as $key => $val) {
>     $browserArray = array($key, $val);
>    }
> 
> 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
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
> 
> 
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030530/321432d9/attachment.html>


More information about the talk mailing list