PHP code example of loophp / phposinfo
1. Go to this page and download the library: Download loophp/phposinfo library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
loophp / phposinfo example snippets
oophp\phposinfo\OsInfo;
use loophp\phposinfo\Enum\Family;
use loophp\phposinfo\Enum\Os;
// Register constants if they do not exists:
// * PHP_OS_FAMILY
// * PHP_OS
// * PHPOSINFO_OS_FAMILY
// * PHPOSINFO_OS
OsInfo::register();
// Get the OS name.
OsInfo::os();
// Get the OS family.
OsInfo::family();
// Check if the OS is Unix based.
OsInfo::isUnix();
// Check if the OS is Apple based.
OsInfo::isApple();
// Check if the OS is Windows based.
OsInfo::isWindows();
// Check the OS version.
OsInfo::version();
// Check the OS release.
OsInfo::release();
// Check if the OS Family is Family::UNIX_ON_WINDOWS.
OsInfo::isFamily(Family::UNIX_ON_WINDOWS);
// Check if the OS is Os::FREEBSD.
OsInfo::isOs(Os::FREEBSD);
// Check if the OS is Windows.
OsInfo::isOs('windows');
// Check if the OS family is darwin.
OsInfo::isFamily('darwin');
// Get the machine UUID.
OsInfo::uuid();