Re: Question regarding OS
| From: | tedd | Date: | Tue, 27 Jun 2006 02:25:52 +0000 |
| Subject: | Re: Question regarding OS | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238676@lists.php.net to get a copy of this message | ||
At 11:46 AM +1000 6/27/06, Ligaya Turmelle wrote:
>Mayank Maheshwary wrote:
>>Hi,
>>
>>Is there a function that can detect the OS on which the script is running?
>>
>>Thank you.
>>
>>M.
>>
>The OS of the server maybe $_SERVER['SERVER_SOFTWARE'] - *shrug*
>The OS of the client is not available - server side - remember.
???
If you mean, the server where your php script is running, then
$_SERVER['SERVER_SOFTWARE'].
If you mean, what the OS and browser of the client who is viewing the product of your script, then
try $_SERVER('HTTP_USER_AGENT').
If I remember correctly, these are not "guaranteed" across all servers -- but are typical.
tedd
--
------------------------------------------------------------------------------------
http://sperling.com http://ancientstones.com http://earthstones.com