Re: Re: HTML_quickform setdefaults question

From: Date: Sun, 10 Dec 2006 21:29:19 +0000
Subject: Re: Re: HTML_quickform setdefaults question
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26068@lists.php.net to get a copy of this message
rav k wrote: > Hmm not working quite right: > > My $checked array is like this: > > array(4) { > [0]=> array(1) { ["skillid"]=> int(2) } > [1]=> array(1) { ["skillid"]=> int(3) } > [2]=> array(1) { ["skillid"]=> int(6) } > > So 2, 3, 6 means that skills[2], skills[3] and skills[6] should be checked. > > I did this: > > foreach ($checked as $s) { > $checked['skills['.$s.']'] =1; > } [...] Okay, that's not a PEAR question anymore (it's a PHP question), but this should work: $checked['skills[' . $s['skillid'] . ']'] = 1; Regards, Mark

« previous php.pear.general (#26068) next »