← All built-ins / ltrim()

ltrim()

ltrim(...$args): string

Parameters

NameTypeDescription
$sstringinput string

Return value

The string without leading whitespace.

Example

echo "[" . ltrim("   hello  ") . "]";
[hello  ]

See also

trim()rtrim()