array_diff usage
| From: | V e r b a l | Date: | Mon, 02 Apr 2001 07:41:07 +0000 |
| Subject: | array_diff usage | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46573@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.
V e r b a l