My question is:
I have the following array:
$array = array(10, 30, 10, 40, 40);
I would like to know if there is a simple way to display the message: "There are duplicate values" or "There are no duplicate values".
The array_count_values()
function could manipulate this array together with foreach()
by comparing result to result until you find an amount greater than 1. However, I would like to get away from this analysis because I only need to know if duplicate values occur and not what are these values. Would anyone have another idea?