Re: array_diff usage
| From: | Martin Skjöldebrand | Date: | Mon, 02 Apr 2001 15:15:26 +0000 |
| Subject: | Re: array_diff usage | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46624@lists.php.net to get a copy of this message | ||
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 $lines;
> var_dump($test);
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?)
M.