Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

php_uname

Description

The php_uname of Options / Information for PHP returns information about the operating system PHP is running on.

Syntax

php_uname(
    string $mode = "a"
): string

Parameters

mode

mode is a single character that defines what information is returned.

CharacterDefinitionExample
aAll modes in the sequence. Default."s n r v m"
sOperating system nameFreeBSD
nHost namelocalhost.example.com
rRelease name5.1.2-RELEASE
vVersion informationVaries between operating systems
mMachine typei386

Return

Returns the description, as a string.

Examples

1 · void

<?

$return = php_uname();

echo $return;

?>
Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686

2 · mode · a

<?

$mode = "a";

$return = php_uname($mode);

echo $return;

?>
Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686

3 · mode · s

<?

$mode = "s";

$return = php_uname($mode);

echo $return;

?>
Linux

4 · mode · n

<?

$mode = "n";

$return = php_uname($mode);

echo $return;

?>
localhost

5 · mode · r

<?

$mode = "r";

$return = php_uname($mode);

echo $return;

?>
2.4.21-0.13mdk

6 · mode · v

<?

$mode = "v";

$return = php_uname($mode);

echo $return;

?>
#1 Fri Mar 14 15:08:06 EST 2003

7 · mode · m

<?

$mode = "m";

$return = php_uname($mode);

echo $return;

?>
i686

8 · Constants

<?

echo PHP_OS . PHP_EOL;
echo DIRECTORY_SEPARATOR . PHP_EOL;
echo PHP_SHLIB_SUFFIX . PHP_EOL;
echo PATH_SEPARATOR;

?>
Linux
/
so
:
HomeMenu