| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2001-07-17 07:01 UTC] xinkun at soi dot city dot ac dot uk
 array_diff and array_intersect (maybe also other array functions) change the original order from compared arrays, could you keep the initial order? Thanks PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 11:00:01 2025 UTC | 
User added example: array1={a, b, c ,d}, array2={c, f, b} if do array_intersect(array1, array2), return b,c if do array_intersect(array2, array1), return c,b ----------------- So it keeps the original order of the first array mentioned. Bug a bug, as this is exaclty what should happen. Derick