1--TEST--
2Test ltrim() function : basic functionality
3--FILE--
4<?php
5
6echo "*** Testing ltrim() : basic functionality ***\n";
7
8$text  = " \t\r\n\0\x0B ---These are a few words---  ";
9$hello  = "!===Hello World===!";
10$binary = "\x09\x0AExample string";
11$alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
12
13echo "\n-- Trim string with all white space characters --\n";
14var_dump(ltrim($text));
15
16echo "\n-- Trim non-whitespace from a string --\n";
17var_dump(ltrim($hello, "=!"));
18
19echo "\n-- Trim some non-white space characters from a string --\n";
20var_dump(ltrim($hello, "!oleH="));
21
22echo "\n-- Trim some non-white space characters from a string suing a character range --\n";
23var_dump(ltrim($alpha, "A..Z"));
24
25
26echo "\n-- Trim the ASCII control characters at the beginning of a string --\n";
27var_dump(ltrim($binary, "\x00..\x1F"));
28
29?>
30--EXPECT--
31*** Testing ltrim() : basic functionality ***
32
33-- Trim string with all white space characters --
34string(29) "---These are a few words---  "
35
36-- Trim non-whitespace from a string --
37string(15) "Hello World===!"
38
39-- Trim some non-white space characters from a string --
40string(10) " World===!"
41
42-- Trim some non-white space characters from a string suing a character range --
43string(10) "0123456789"
44
45-- Trim the ASCII control characters at the beginning of a string --
46string(14) "Example string"
47