<?php
$courses = array('teste', 'teste2', 'testexyz','teste3', 'teste', 'testexyz'); function get_duplicates( $array ) {
}
$list = get_duplicates($courses);
PD9waHAKCiRjb3Vyc2VzID0gYXJyYXkoJ3Rlc3RlJywgJ3Rlc3RlMicsICd0ZXN0ZXh5eicsJ3Rlc3RlMycsICd0ZXN0ZScsICd0ZXN0ZXh5eicpOwpmdW5jdGlvbiBnZXRfZHVwbGljYXRlcyggJGFycmF5ICkgewogICAgcmV0dXJuIGFycmF5X3VuaXF1ZSggYXJyYXlfZGlmZl9hc3NvYyggJGFycmF5LCBhcnJheV91bmlxdWUoICRhcnJheSApICkgKTsKfQokbGlzdCA9IGdldF9kdXBsaWNhdGVzKCRjb3Vyc2VzKTsKCnByaW50X3IoJGxpc3QpOw==