array_diff usage

From: Date: Sun, 01 Apr 2001 04:52:09 +0000
Subject: array_diff usage
Groups: php.db 
Request: Send a blank email to php-db+get-8084@lists.php.net to get a copy of this message
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++) { print $test[0]; } gives me "5". What I was hoping was that $lines should be 3 and that I'd get 3 4 5 printed. M.

« previous php.db (#8084) next »