"Frederic Noyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On 30 avr. 04, at 11:31, Torsten Roehr wrote: > > > "Frederic Noyer" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> > >> On 30 avr. 04, at 11:00, Torsten Roehr wrote: > >>>> > >>> > >>> I think this is correct because the 3 key/value pairs from the first > >>> array > >>> are NOT in the second one. I think the combination of key and value > >>> are > >>> relevant for array_diff(). > >> > >> As I have understand only the array_diff_assoc function does that. > >> see php.net: > >> > >> "Description > >> array array_diff_assoc ( array array1, array array2 [, array ...]) > >> > >> array_diff_assoc() returns an array containing all the values from > >> array1 that are not present in any of the other arguments. Note that > >> the keys are used in the comparison unlike array_diff()." > > > > So array_diff() seems to be for arrays where the key is not defined so > > that > > only values are recognized. > > > > Regards, Torsten > > Any ideas what this implies in termes of code ? > You mean, I should not fill my array with values this way ? > "$arr2[] = (string) $recListAut['aut_id'];"
If the keys are not important for you that would be the way to do it, although I don't think you need (string). If the keys are important you should use array_diff_assoc(). Regards, Torsten > > Because this is precisely the way to fill it without specifying the > key. see www.php.net: > http://ch2.php.net/manual/en/language.types.array.php > > Regards, Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php