I have an array of IDs, lots of the IDs occur multiple times and I'm using array_count_values() to count how many times each ones occurs.
I want to do something if a specific ID occurs more than 3 times, I just can't figure out how to get the array_count_values() result into a foreach loop so I can use it.
Any help appreciated!
$array = array("297","297","297","297","188","188");
print_r( array_count_values($array) );
// loop room booking data
foreach($array as $key => $val) {
// if the ID occurs more than 3 times
if ( $val > '3' ) {
// do something
}
}