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 / array_count_values str_repeat rtrim
last run:
2023-08-27 08:06:40
15
- PHP 8.1 / MySQL 8.0 rtrim str_repeat count var_export
last run:
2025-03-28 09:02:29
11
- PHP 8.1 / file_exists file_get_contents preg_match_all parse_url rtrim
last run:
2022-07-12 14:01:54
10
- PHP 8.1 / array_count_values str_repeat rtrim
last run:
2023-08-27 15:22:28
9
- PHP 8.1 / 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 / preg_match rtrim implode
last run:
2024-07-23 19:01:28
4
- PHP 8.1 / array_count_values str_repeat rtrim
last run:
2023-08-27 09:03:55
3
- PHP 8.1 / count rtrim
last run:
2022-09-15 05:55:37
3
rtrim - New snippets
-
PHP 8.4 / MySQL 8.0 rtrim base64_encode base64_decode substr openssl_cipher_iv_length openssl_decrypt json_decode print_r
added at:
2025-04-01 03:14:56
1
-
PHP 8.4 / MySQL 8.0 rtrim base64_decode openssl_cipher_iv_length substr openssl_decrypt
added at:
2025-04-01 03:07:36
1
-
PHP 8.4 / MySQL 8.0 rtrim openssl_cipher_iv_length substr openssl_decrypt json_decode print_r
added at:
2025-04-01 02:59:49
1
-
PHP 8.4 / MySQL 8.0 define openssl_random_pseudo_bytes openssl_cipher_iv_length openssl_encrypt rtrim strtr base64_encode
added at:
2025-03-31 07:47:31
1
-
PHP 8.4 / MySQL 8.0 openssl_random_pseudo_bytes openssl_cipher_iv_length openssl_encrypt rtrim strtr base64_encode
added at:
2025-03-31 07:45:59
1
-
PHP 8.4 / MySQL 8.0 openssl_random_pseudo_bytes openssl_cipher_iv_length openssl_encrypt rtrim strtr base64_encode
added at:
2025-03-31 07:45:15
1
-
PHP 7.4 / MariaDB 11.4 explode trim count rtrim substr json_decode
added at:
2025-02-13 17:38:00
1
-
PHP 8.1 / gettype str_replace rtrim
added at:
2025-01-09 13:13:23
1
-
PHP 8.1 / strtolower strlen ord rtrim
added at:
2024-12-27 16:48:54
1
-
PHP 8.1 / strtolower strlen ord rtrim
added at:
2024-12-27 16:48:18
1