Posted By

Jotape on 08/31/11


Tagged

php apache


Versions (?)

Get Apache Version


 / Published in: PHP
 

  1. function apache_version()
  2. {
  3. if (function_exists('apache_get_version'))
  4. {
  5. if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', apache_get_version(), $version))
  6. {
  7. return $version[1].'.'.$version[2].'.'.$version[3];
  8. }
  9. }
  10. elseif (isset($_SERVER['SERVER_SOFTWARE']))
  11. {
  12. if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', $_SERVER['SERVER_SOFTWARE'], $version))
  13. {
  14. return $version[1].'.'.$version[2].'.'.$version[3];
  15. }
  16. }
  17.  
  18. return '(unknown)';
  19. }

Report this snippet  

You need to login to post a comment.