Re: Please help me with in_array

From: Date: Fri, 04 Aug 2006 22:29:05 +0000
Subject: Re: Please help me with in_array
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-240172@lists.php.net to get a copy of this message
Chris G wrote: > I have already tried using > > foreach($_GET['question'] as $key => $value) > > the in_array function does not work with it for some reason. 'does not work with it' ?? use var_dump(); to see what's actually in your variables. > > > On 8/5/06, *Jochem Maas* <jochem@iamjochem.com > <mailto:jochem@iamjochem.com>> wrote: > > foreach($_GET['question'] as $key => $value) { > var_dump($key, $value); > > if(!in_array($key, $_SESSION['question'])) { > > print "not matched lets update<br>". > > "$_GET[question][$key]"; // HERE I WANT IT TO > SHOW $key > > is 10 and its value should be 1 (as printed in the Array above) > > } > > else { > > print "matched"; > > } > > } > > > > > > > > Where it gets to the section "not matched" I need to print out > from the > > question array question[$key][$value] (question '10' => '1' as > > above) > > > > > > > > I am not sure if I am even making sense here anymore... > > > > Thanks in advance > > > > > > Chris > > > >

« previous php.general (#240172) next »