$value){ if(strpos($key, 'utm_') !== false){ setcookie ($key, $value,time()+(40*24*60*60*100)); } } } $paramArray = []; foreach ($_COOKIE as $key => $item){ if(strpos($key, 'utm_') !== false){ $paramArray[$key] = $item; } } $param_str = ''; if(!empty($paramArray)){ $param_str = http_build_query($paramArray); }elseif(!empty($_SERVER['QUERY_STRING'])){ $param_str = $_SERVER['QUERY_STRING']; } ?>