I thinks, that this is a question not of quick coding, but of losing valueable information about the structure of your data. You can compare some derivatives of the arrays if and
if that's a reversible derivative. Think of stringification of an array which could always be transformed back into the original array. You could e.g. escape all spaces in the array components and then join with spaces. This would yield a string which can be used for comparison.