← All built-ins / getenv()
getenv()
getenv(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string | environment variable name |
Return value
Value of the variable, empty string when unset.
Example
echo getenv("PATH") != "" ? "has-PATH" : "no-PATH";has-PATH