Используйте parse_url
для анализа домена каждого элемента и сохранения массива для отслеживания частоты каждого домена.
$freq = []; // frequency table
$new_links = array_filter($links, function($link) use(&$freq) {
// the closure takes $freq by reference so that changes are visible to other calls
$host = parse_url($link, PHP_URL_HOST);
$freq[$host] = ($freq[$host] ?? 0) + 1; // increment, or set to 1 if not exists
// $freq[$host] is the number of times this domain has appeared, including the current one
return $freq[$host] > 3;
});