PHP chop() function is used to remove whitespace from the end of a string.
Syntax
string chop(str,charlist);
Parameter | Description |
---|---|
str : | Required parameter. A string or text. |
charlist : | Optional parameter. Characters to be remove from the string. |
Return Value : | Returns the modified string. |
<?php echo chop("Hello world! "); ?>