Return to Snippet

Revision: 50726
at August 31, 2011 09:24 by Jotape


Initial Code
function apache_version()
	{
		if (function_exists('apache_get_version'))
		{
			if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', apache_get_version(), $version))
			{
				return $version[1].'.'.$version[2].'.'.$version[3];
			}
		}
		elseif (isset($_SERVER['SERVER_SOFTWARE']))
		{
			if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', $_SERVER['SERVER_SOFTWARE'], $version))
			{
				return $version[1].'.'.$version[2].'.'.$version[3];
			} 
		}
		
		return '(unknown)';
	}

Initial URL

                                

Initial Description

                                

Initial Title
Get Apache Version

Initial Tags
php, apache

Initial Language
PHP