Skip to content

Instantly share code, notes, and snippets.

@andrew-kzoo
Created April 22, 2013 20:23
Show Gist options
  • Select an option

  • Save andrew-kzoo/5438193 to your computer and use it in GitHub Desktop.

Select an option

Save andrew-kzoo/5438193 to your computer and use it in GitHub Desktop.
SharePoint Mythbusting: The response header contains the current SharePoint version http://www.wictorwilen.se/sharepoint-mythbusting-the-response-header-contains-the-current-sharepoint-version
<?php
function getSharePointVersion($url)
{
$headers = array();
$raw_headers = get_headers($url);
foreach($raw_headers as $index => $raw_header)
{
if($index > 0)
{
list($name, $value) = explode(": ", $raw_header, 2);
if($name === "MicrosoftSharePointTeamServices")
{
return $value;
}
}
}
return "UNKNOWN";
}
$url = "http://sharepoint_site_url/";
echo getSharePointVersion($url);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment