note 49099 deleted from function.apache-get-version by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 16 Jan 2005 20:16:21 +0000 |
| Subject: | note 49099 deleted from function.apache-get-version by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83460@lists.php.net to get a copy of this message | ||
Note Submitter: Pedro
----
I just wanted to get the Apache version number I was running but apache_get_version returned a
string like this:
Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10
FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
Not very user-friendly if you're trying to tell them what version they're running, so I
came up with this:
<?php
echo("Apache: <strong>" . preg_replace("/\) (.*)/i", ")",
ereg_replace("Apache/", "", apache_get_version())) .
"</strong>.");
?>
Which returns something like:
Apache: <strong>1.3.33 (Unix)</strong>.
It's probably not very efficient but I hope it helps someone.