lulu: zu blöd für Arrays....

Beitrag lesen

Huhu Andreas

$array1 = array (1, 2, 3);
$array2 = array (4, 1, 2);
$result = array_diff ($array1, $array2);

da kommt gatr nichts bei raus!

bei mir kommt 3 raus.

Das stimmt dann ja mit der Funktionsbeschreibung überein:

array_diff() returns an array containing all the values of array1 that are not present in any of the other arguments.

Weil es ein beliebter, geradezu klassischer Fehler ist frage ich mal:
Du weißt schon, daß Array-Indizes i.d.R. bei 0 beginnen?

Viele Grüße

lulu