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 file_exists file_get_contents preg_match_all parse_url rtrim
last run:
2022-07-12 14:01:54
10
- PHP 8.1 / MySQL 8.0 rtrim str_repeat count var_export
last run:
2023-04-13 07:14:00
5
- 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 8.1 / MySQL 8.0 rtrim str_repeat count var_export
last run:
2022-06-06 21:03:37
2
- PHP 8.0 / MySQL 5.7 rtrim
last run:
2021-12-17 09:55:31
2
- PHP 8.0 / MySQL 5.7 rtrim
last run:
2021-12-17 09:55:05
2
- PHP 8.0 / MySQL 8.0 mysqli_query rtrim array_push print_r count
last run:
2021-08-15 17:03:48
2
- PHP 8.0 / MySQL 8.0 mysqli_query rtrim array_push print_r count
last run:
2021-08-15 16:55:01
2
rtrim - New snippets
-
PHP 8.0 / MySQL 5.7 rtrim str_repeat count
added at:
2023-05-11 11:02:59
1
-
PHP 7.4 / MariaDB 10 rtrim str_repeat count var_export rtrim str_repeat count var_export
added at:
2023-04-13 07:15:35
1
-
PHP 5.6 / MariaDB 10 rtrim str_repeat count var_export
added at:
2023-04-13 07:15:00
1
-
PHP 8.1 / MariaDB 10 rtrim str_repeat count var_export
added at:
2023-04-13 07:14:52
1
-
PHP 8.0 / MariaDB 10 rtrim str_repeat count var_export
added at:
2023-04-13 07:14:48
1
-
PHP 8.1 / MySQL 8.0 rtrim str_repeat count var_export
added at:
2023-03-19 20:45:15
1
-
PHP 8.1 / MS SQL Server 2017 rtrim
added at:
2023-02-09 13:27:50
1
-
PHP 8.1 / MS SQL Server 2017 rtrim
added at:
2023-02-09 13:27:33
1
-
PHP 8.1 / MS SQL Server 2017 rtrim
added at:
2023-02-09 13:22:35
1