Questa funzione restituisce true se il server gira in ambiente Windows, false in caso contrario.
function runsOnWindows() { php_uname(); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return true; } return false; }
Ci sono infatti delle funzioni php (per esempio strptime) che non sono definite in ambiente Windows e, se richiamate, generano un errore del tipo
Fatal error: Call to undefined function strptime() in ...