rtrim
rtrim — Strip whitespace (or other characters) from the end of a string.Description
rtrim( string $string,This function returns a string with whitespace (or other characters) stripped from the end of string.
string $characters = " \n\r\t\v\0" ): string
Without the second parameter, rtrim() will strip these characters:
• " " (ASCII 32 (0x20)), an ordinary space.
• "\t" (ASCII 9 (0x09)), a tab.
• "\n" (ASCII 10 (0x0A)), a new line (line feed).
• "\r" (ASCII 13 (0x0D)), a carriage return.
• "\0" (ASCII 0 (0x00)), the NUL-byte.
• "\v" (ASCII 11 (0x0B)), a vertical tab.
Parameters
string
The string that will be trimmed.
characters
Optionally, the stripped characters can also be specified using the characters parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters.
Return Values
Returns the modified string.More information about rtrim on official PHP documentation site
rtrim - Popular snippets
- PHP 8.1 / MySQL 5.7 array_count_values str_repeat rtrim
last run:
2023-08-27 08:06:40
15
- PHP 8.1 / MySQL 5.7 file_exists file_get_contents preg_match_all parse_url rtrim
last run:
2022-07-12 14:01:54
10
- PHP 8.1 / MySQL 5.7 array_count_values str_repeat rtrim
last run:
2023-08-27 15:22:28
9
- PHP 8.1 / MySQL 8.0 rtrim str_repeat count var_export
last run:
2023-10-15 01:44:20
9
- PHP 8.1 / MySQL 5.7 array_count_values str_repeat rtrim
last run:
2023-08-27 07:59:14
8
- PHP 8.1 / MySQL 8.0 array_chunk date strtotime rtrim
last run:
2024-02-01 17:49:43
5
- PHP 8.1 / MySQL 8.0 array_chunk rtrim
last run:
2024-02-01 17:48:56
5
- PHP 8.1 / MySQL 5.7 preg_match rtrim implode
last run:
2024-07-23 19:01:28
4
- PHP 8.1 / MySQL 5.7 array_count_values str_repeat rtrim
last run:
2023-08-27 09:03:55
3
- PHP 8.1 / MySQL 5.7 count rtrim
last run:
2022-09-15 05:55:37
3
rtrim - New snippets
-
PHP 8.0 / MySQL 5.7 rtrim array_rand
added at:
2024-08-11 06:26:58
1
-
PHP 8.1 / MySQL 5.7 rtrim implode
added at:
2024-07-23 19:01:45
1
-
PHP 8.1 / MySQL 5.7 preg_match rtrim implode
added at:
2024-07-23 19:01:20
4
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2024-03-07 10:04:39
1
-
PHP 8.1 / MySQL 5.7 strlen rtrim
added at:
2024-02-12 12:16:00
1
-
PHP 8.1 / MySQL 8.0 array_chunk rtrim array_chunk rtrim array_chunk rtrim array_chunk rtrim
added at:
2024-02-01 17:49:01
1
-
PHP 8.1 / MySQL 8.0 array_chunk date strtotime rtrim
added at:
2024-02-01 17:47:40
5