Welcome! Log In Create A New Profile

Advanced

[PHP] How to know what current system is?

Posted by Jiang Miao 
Jiang Miao
[PHP] How to know what current system is?
October 13, 2008 10:55PM
Is there any function do that?
when php in Linux it returns linux
in windows it returns windows

I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu
2.6.24-19-server. but I have no idea to get that info.

Thanks
Jiang Miao


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Shawn McKenzie
[PHP] Re: How to know what current system is?
October 13, 2008 11:25PM
Jiang Miao wrote:
> Is there any function do that?
> when php in Linux it returns linux
> in windows it returns windows
>
> I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu
> 2.6.24-19-server. but I have no idea to get that info.
>
> Thanks
> Jiang Miao
>

PHP_OS constant.

-Shawn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tom Shaw
RE: [PHP] How to know what current system is?
October 13, 2008 11:30PM
You can try, $_SERVER['SERVER_SOFTWARE']

-----Original Message-----
From: news [mailto:[email protected]] On Behalf Of Jiang Miao
Sent: Monday, October 13, 2008 3:44 PM
To: php-general@lists.php.net
Subject: [PHP] How to know what current system is?

Is there any function do that?
when php in Linux it returns linux
in windows it returns windows

I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu
2.6.24-19-server. but I have no idea to get that info.

Thanks
Jiang Miao


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login