88 of 110 menu

PHP Remove Duplicate Array Elements

To remove duplicate array elements, use the array_unique function. See example:

<?php $arr = [1, 2, 2, 3, 4, 4]; $arr = array_unique($arr); var_dump($arr); ?>

Code execution result:

[1, 2, 3, 4]
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline