PHP – Check If a Web Server is running on Windows or Linux
The following code shows you how to check if a web server is running on Windows or Linux by looking at PHP_OS
const.
example.php
if (PHP_OS === 'WINNT') {
echo 'This is a server using Windows';
} else if (PHP_OS === 'Linux') {
echo 'This is a server using Linux';
} else {
echo 'using another os';
}
it works, thnx
keep it up
it works fine for me