get system release in php

To get the system release information in PHP, you can use the uname command which returns information about the current system such as the kernel name, network node hostname, kernel release, kernel version, machine hardware name, and operating system.

You can use PHP's shell_exec function to execute the uname -r command, which will return the release information of the current system:

main.php
$release = shell_exec('uname -r');

echo $release; // prints something like "4.15.0-112-generic"
97 chars
4 lines

This will store the system release information in the $release variable and then print it to the console.

gistlibby LogSnag