Get Apache Version


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.