Q:

Write a PHP script to get the information about the operating system PHP is running on

0

Write a PHP script to get the information about the operating system PHP is running on.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
 echo php_uname()."\n";
echo PHP_OS."\n";
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
echo 'This is a server using Windows!';
} else {
echo 'This is a server not using Windows!'."\n";
}
?>

Sample Output:

Linux programming-editor 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 
15:29:09 UTC 2017 x86_64                                            
Linux                                                               
This is a server not using Windows!

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now