Use array_diff and escape attributes.