I am parsing an IMAP inbox and extracting the attachments, I add the attachment filename to an array like this:
$extracted['file_uploads/'.$user_id.'_'.$path_parts['filename'].'_'.$md.'.'.$path_parts['extension']] = $user_id
($user_id is a value that corresponds to the email account that the message is from)
Now, what I need to do before iterating through this array and handling the attachments, is to sort the array by user_id AND filename (DESC)
This is because, for certain users, the files may not be extracted in a particular order but and they must be handled in the correct order.
How would I do that?