Re: [PHP] array_diff usage

2001-04-02 Thread Stig Venaas
On Mon, Apr 02, 2001 at 05:15:26PM +0200, Martin Skjöldebrand wrote: > I'm afraid I dont quite under stand the output you gave (maybe ... or do > you mean var_dump included the number of the array elements?) First I echoed the number, then var_dump() also printed it, try var_dump yourself. Stig

Re: [PHP] array_diff usage

2001-04-02 Thread Martin Skjöldebrand
Stig Venaas wrote: > So the arrays contain one string each? array_diff() won't work then. Sorry - my fault. I'm getting the values from a database - not manually added. > Try this: > > $a = array(1, 2, 3, 4, 5); > $b = array(1, 2); > $test = array_diff($a, $b); > $lines = count($test); > echo

Re: [PHP] array_diff usage

2001-04-02 Thread Stig Venaas
On Mon, Apr 02, 2001 at 12:41:07AM -0700, V e r b a l wrote: > I'm daft. I don't understand the PHP Manual. > > I have two arrays: > Open[0] contains 1 2 3 4 5 > Closed[0] contains 1 2 So the arrays contain one string each? array_diff() won't work then. Try this: $a = array(1, 2, 3, 4, 5); $b =

[PHP] array_diff usage

2001-04-02 Thread V e r b a l
I'm daft. I don't understand the PHP Manual. I have two arrays: Open[0] contains 1 2 3 4 5 Closed[0] contains 1 2 Now: $test = array_diff($Open, $Closed); $lines = count($test); print $lines; Gives me: 1 I thought it should be 3. While: for ($counter =0; $counter <= $lines -1; $counter++) {