get system type in php

To get the system type in PHP, you can use the php_uname() function. Here's an example:

main.php
$systemType = php_uname('s');
echo 'System Type: ' . $systemType; // Output: System Type: Linux (or Windows, or Darwin for macOS)
130 chars
3 lines

The 's' parameter passed to php_uname() returns the operating system name. You can also pass other parameters to get additional system information, such as 'n' for the network name or 'r' for the release number.

gistlibby LogSnag