Efficiently Remove Duplicates from a PHP Array While Preserving Original Formatting