Hello to all. I have a problem and I would like to have your advice. I have an array that holds some duplicate values and I would like to repeat a process as long as the value exists in this array, then to go and check for the next value and if is also duplicate repeat the same process ….etc. thanks you for your time
function give_apples($person){ echo 'Give '.$person.' an apple <br>'; }//end give_apples function give_orange($person){ echo 'Give '.$person.' an orange <br>'; }//end give_orange $class = array('John','Paul','Smith','Paul','John','Paul'); //<--- a duplication array value foreach($class as $person){ ($person == 'John')?give_apples($person):give_orange($person); }//end foreach PHP: