Now my approach ...
if ( preg_match( '~IIS/(\d+\.\d+)~', $_SERVER['SERVER_SOFTWARE'], $matches ) ) $version = $matches[1];
... but I have no experience with IIS, and after some searching, I did not find any information on how reliable it is. The signature of the server may be suppressed, or the template may be changed in older versions or with additional software.
Is it possible to determine the full version of IIS with PHP? Perhaps with extensions only for Windows ? Are there any pitfalls I should know about?
fuxia source share