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 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
- PHP 8.1 / MySQL 5.7 strpos file_get_contents preg_match_all parse_url rtrim
last run:
2022-07-09 18:58:28
3
- PHP 8.1 / MySQL 5.7 dirname str_replace ltrim rtrim substr curl_init curl_setopt curl_exec curl_close
last run:
2022-06-14 00:56:17
3
- PHP 7.4 / MySQL 5.7 implode rtrim str_repeat count mysqli_prepare array_merge
last run:
2023-12-04 15:33:06
2
rtrim - New snippets
-
PHP 7.4 / MySQL 5.7 implode rtrim str_repeat count mysqli_prepare array_merge call_user_func_array print_r
added at:
2023-12-04 15:57:53
1
-
PHP 7.4 / MySQL 5.7 implode rtrim str_repeat count mysqli_prepare array_merge
added at:
2023-12-04 15:33:42
1
-
PHP 7.4 / MySQL 5.7 implode rtrim str_repeat count mysqli_prepare array_merge
added at:
2023-12-04 15:32:57
2
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:10:47
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:10:41
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:10:22
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:05:47
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:05:36
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:05:32
1
-
PHP 7.4 / MySQL 5.7 count join array_keys rtrim mysqli_prepare
added at:
2023-12-04 11:05:18
1