Hi i'm trying to write the function I write one that work but the problem some platforms don't have
$_SERVER['HTTP_REFERER'] link snapchat
this is the function
function Contains($str, array $allsocial)
{
foreach ($allsocial as $item) {
if (strstr($str, $item)) {
echo preg_replace("#^[^:/.]*[:/]+#i", "", $str);
} else {
echo "Special char not found.";
}
}
}
function RefeerVisit($ID)
{
if (isset($_SERVER['HTTP_REFERER'])) {
$allsocail = array("titok", "instagram", "twitter", "snapchat");
$Refeer = $_SERVER['HTTP_REFERER'];
Contains($Refeer, $allsocail);
} else {
echo 'Direct';
}
}
if (isset($_REQUEST['q'])) {
RefeerVisit(1);
}
it work on Instagram twitter