PHP Conference Kansai 2025

Voting

: min(five, zero)?
(Example: nine)

The Note You're Voting On

MagicalTux at FF dot st
19 years ago
When you need to get the OS, do not use $_SERVER['OS'] or $_ENV['OS'], better use PHP_OS constant !
<?php
if (substr(PHP_OS,0,3)=='WIN') {
// [...]
}
?>

You also have other values such as CYGWIN_NT-5.0, Linux, ... this is the best way to get system's os (anyone on linux can do an "export OS=windows")

<< Back to user notes page

To Top