← All built-ins / chop()

chop()

chop(string $s): string

Parameters

NameTypeDescription
$sstringinput string

Return value

Same as rtrim().

Example

echo "[" . chop("hello\n") . "]";
[hello]

See also

rtrim()