← All built-ins / trim()
trim()
trim(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | input string |
Return value
The string without leading or trailing whitespace.
Example
echo "[" . trim(" hello\n\t ") . "]";[hello]
| Name | Type | Description |
|---|---|---|
| $s | string | input string |
The string without leading or trailing whitespace.
echo "[" . trim(" hello\n\t ") . "]";[hello]