RE: [PHP] Finding value in multi-dimensional array - Solved

2004-04-14 Thread Ford, Mike [LSS]
On 10 April 2004 02:21, Verdon Vaillancourt wrote: > Hi, > > Thanks much to Richard and Andy for the input :) This one > did the job... > > if($_SESSION['OBJ_user']->modSettings['listings']['active'] == '1') { > > I'm still not entirely sure I understand the syntax ;) Well, by relating back t

Re: [PHP] Finding value in multi-dimensional array - Solved

2004-04-09 Thread Verdon Vaillancourt
Hi, Thanks much to Richard and Andy for the input :) This one did the job... if($_SESSION['OBJ_user']->modSettings['listings']['active'] == '1') { I'm still not entirely sure I understand the syntax ;) verdon > From: Richard Harb <[EMAIL PROTECTED]> > Date: Fri, 9 Apr 2004 22:49:44 +0200 >

Re: [PHP] Finding value in multi-dimensional array

2004-04-09 Thread Richard Harb
No problem .. Let's see: if($_SESSION['OBJ_user']->modSettings['listings']['active'] == '1') { That should be it ... Sidenote: use single quotes whenever the string needn't be evaluated (i.e. is a variable itself) you save a couple cycles every time. hth Richard Friday, April 9, 2004, 10:32:25

Re: [PHP] Finding value in multi-dimensional array

2004-04-09 Thread Verdon Vaillancourt
Sorry, my example was poor :) Thanks for the print_r tip. When added to the bottom of the page, print_r($_SESSION["OBJ_user"]); Prints... phpws_user Object ( [user_id] => 5 [username] => agent [password] => 77abcd5cb2ef4a366c2749ea9931c79e [email] => [EMAIL PROTECTED] [admin_

Re: [PHP] Finding value in multi-dimensional array

2004-04-09 Thread Richard Harb
do a print_r() for the structure. --> print_r($_SESSION["OBJ_user"]); and look at the page source. at each level ... if is says array refer to it with ['property'] if obj (stdClass or otherwise) use -> that arrow thingy I am not sure what the arrows in you desc mean, whether it's key/value pair o

[PHP] Finding value in multi-dimensional array

2004-04-09 Thread Verdon Vaillancourt
Hi, being somewhat of a noob, I hope I'm using the right language to phrase this question... In a project I am working with, I have a multi-dimensional array in session when a user logs in. Visually, it looks something like this... OBJ_user username => value isAdmin => value modSettin