RE: [PHP] Logic headache, please help.

From: Date: Mon, 11 Nov 2002 15:19:33 +0000
Subject: RE: [PHP] Logic headache, please help.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123816@lists.php.net to get a copy of this message
> -----Original Message----- > From: Marco Tabini [mailto:marcot@tabini.ca] > Sent: 11 November 2002 14:46 > To: Tony Crockford > Cc: Php-General@Lists. Php. Net > Subject: Re: [PHP] Logic headache, please help. > > > How about building an array of all the levels: > > $a = array(); > > for ($i = 1; $i <= $maxlevels; $i++) > $a[] = $i; > > then for each level you can create a new array that is the difference > between the original array and an array that contains the > current level: > > for ($i = 1; $i <= $maxlevels; $i++) > $a1 = ; > echo '<option value="' . implode ('|', array_diff ($a, > array($i))) . > '">Level ' . $i; > > I'm not 100% that this will work right off the bat, but it should at > least put you on the right track... if not out of your misery :-) > > Hope this helps. It looks like it might, but I note this warning in the manual re:array_diff Warning This was broken in PHP 4.0.4! http://www.php.net/manual/en/function.array-diff.php is it fixed in 4.06 do you know? (host uses 4.06, I have 4.2.2) TIA Tony

« previous php.general (#123816) next »