import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / trim_basic.php
blob1440c056b25e07ef989006af148abdc40ff89024
1 <?php
3 /* Prototype : string trim ( string $str [, string $charlist ] )
4 * Description: Strip whitespace (or other characters) from the beginning and end of a string.
5 * Source code: ext/standard/string.c
6 */
8 echo "*** Testing trim() : basic functionality ***\n";
10 $text = " \t\r\n\0\x0B ---These are a few words--- \t\r\n\0\x0B ";
11 $hello = "!===Hello World===!";
12 $binary = "\x0A\x0DExample string\x0A\x0D";
14 echo "\n-- Trim string with all white space characters --\n";
15 var_dump(trim($text));
17 echo "\n-- Trim non-whitespace from a string --\n";
18 var_dump(trim($hello, "=!"));
20 echo "\n-- Trim some non-white space characters from a string --\n";
21 var_dump(trim($hello, "Hdle"));
23 echo "\n-- Trim the ASCII control characters at the beginning of a string --\n";
24 var_dump(trim($binary, "\x00..\x1F"));
27 ===DONE===