How to determine the server operation system (os) with PHP

2 Answers

0 votes
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') 
    echo 'Server using Windows';
else 
    echo 'Server not using Windows';


/*
run:
    
Server using Windows 
       
*/

 



answered Jul 14, 2016 by avibootz
0 votes
if (strtoupper(substr(PHP_OS, 0, 3)) === 'Linux') 
    echo 'Server using Linux';
else 
    echo 'Server not using Linux';


/*
run:
    
Server not using Linux 
       
*/

 



answered Jul 14, 2016 by avibootz

Related questions

2 answers 434 views
1 answer 184 views
1 answer 207 views
2 answers 285 views
285 views asked Dec 4, 2023 by avibootz
2 answers 398 views
398 views asked Jul 10, 2014 by avibootz
...