99
PHP string rtrim() Function
PHP rtrim() is predefined function which is used to remove whitespace or character form the right side of a string.
Syntax:
Parameter | Description | Required/Optional |
---|---|---|
string | Specify the string to check. | required |
charlist | Specify character to remove Following character
| Optional |
Example 1
Output:
Without rtrim() function: Hello PHP! With rtrim() function:Hello PHP!
Example 2
Output:
Without trim() function: Hello PHP! With trim() function: Hello PHP!
Next TopicPHP String