PHP simple wording to heavy

PHP deduplication simple wording
used array_flip implemented to the Weight
<pre>
<? PHP
$ ARR = Array ( "A" => "A1", "B" => 'B1', "C" => "A2", "D" => "A1");
$ array_flip of arr1 = ($ ARR);
print_r ($ of arr1); // first inversion time, remove the duplicates, the output Array ([a1] => d [b1] => b [a2] => c) which preferentially substitute foregoing
$ arr2 is array_flip = ($ of arr1);
print_r ($ arr2 is); // back again reversed, to obtain the re-array output array ([d] = > a1 [b] => b1 [c] => a2)


?>
</ Pre>
This de-emphasis effect more quickly than array_unique

Guess you like

Origin www.cnblogs.com/newmiracle/p/11865493.html