if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $command = 'systeminfo'; //Print out Windows System Information $output = shell_exec($command); echo $output; } else { $command = 'lshw'; //Print out Linux System Hardware Information $output = shell_exec($command); echo $output; }