import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / rtrim_basic.php
blob826e78868d877d6c9013f7345f2f0498f09a1260
1 <?php
3 /* Prototype : string rtrim ( string $str [, string $charlist ] )
4 * Description: Strip whitespace (or other characters) from the end of a string.
5 * Source code: ext/standard/string.c
6 */
8 echo "*** Testing rtrim() : basic functionality ***\n";
10 $text = "---These are a few words--- \t\r\n\0\x0B ";
11 $hello = "!===Hello World===!";
12 $alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
13 $binary = "Example string\x0A\x0D";
17 echo "\n-- Trim string with all white space characters --\n";
18 var_dump(rtrim($text));
20 echo "\n-- Trim non-whitespace from a string --\n";
21 var_dump(rtrim($hello, "=!"));
23 echo "\n-- Trim some non-white space characters from a string --\n";
24 var_dump(rtrim($hello, "!dlWro="));
26 echo "\n-- Trim some non-white space characters from a string using a character range --\n";
27 var_dump(rtrim($alpha, "A..Z"));
29 echo "\n-- Trim the ASCII control characters at the beginning of a string --\n";
30 var_dump(rtrim($binary, "\x00..\x1F"));
33 ===DONE===