mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Update
This commit is contained in:
parent
22f7217ed6
commit
bf6d700807
1 changed files with 6 additions and 2 deletions
|
@ -30,13 +30,17 @@ foreach ($referrers as $key => $value) {
|
|||
// Parse the URL to get the host (domain)
|
||||
$parsedUrl = parse_url($value['external_referrer'], PHP_URL_HOST);
|
||||
if ($parsedUrl) {
|
||||
$referrersTypes[] = $parsedUrl;
|
||||
// Remove 'www.' prefix if it exists
|
||||
$domain = preg_replace('/^www\./', '', $parsedUrl);
|
||||
$referrersTypes[] = $domain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the $referrersTypes is unique
|
||||
// Make sure the $referrersTypes is unique and sorted alphabetically
|
||||
$referrersTypes = array_unique($referrersTypes);
|
||||
sort($referrersTypes);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue