Skip to content

Instantly share code, notes, and snippets.

@timelf123
Created October 3, 2013 16:10
Show Gist options
  • Save timelf123/6812410 to your computer and use it in GitHub Desktop.
Save timelf123/6812410 to your computer and use it in GitHub Desktop.
<?php
$DoNotTrackHeader = "DNT";
$DoNotTrackValue = "1";
$phpHeader = "HTTP_" . strtoupper(str_replace("-", "_", $DoNotTrackHeader));
if((array_key_exists($phpHeader, $_SERVER)) and ($_SERVER[$phpHeader] == $DoNotTrackValue))
{
// Do Not Track is enabled
}
else
{
// Do Not Track is not enabled
}
?>
@timelf123
Copy link
Author

@timelf123
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment