(PHP 4, PHP 5, PHP 7)
ltrim — 删锟斤拷锟街凤拷锟斤拷锟斤拷头锟侥空帮拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷
$str
[, string $character_mask
] ) : string删锟斤拷锟街凤拷锟斤拷锟斤拷头锟侥空帮拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷
str
锟斤拷锟斤拷锟斤拷址锟斤拷锟斤拷锟�
character_mask
通锟斤拷锟斤拷锟斤拷 character_mask
锟斤拷锟斤拷也锟斤拷锟斤拷指锟斤拷锟斤拷要删锟斤拷锟斤拷锟街凤拷锟斤拷锟津单碉拷锟叫筹拷锟斤拷锟斤拷要删锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟缴★拷使锟斤拷..锟斤拷锟斤拷锟斤拷指锟斤拷锟街凤拷锟侥凤拷围锟斤拷
锟矫猴拷锟斤拷锟斤拷锟斤拷一锟斤拷删锟斤拷锟斤拷 str
锟斤拷锟斤拷叩目瞻锟斤拷址锟斤拷锟斤拷址锟斤拷锟斤拷锟�
锟斤拷锟斤拷锟绞癸拷玫诙锟斤拷锟斤拷锟斤拷锟斤拷锟�
ltrim() 锟斤拷删锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷
Example #1 ltrim()锟斤拷使锟矫凤拷锟斤拷
<?php
$text = "\t\tThese are a few words :) ... ";
$binary = "\x09Example string\x0A";
$hello = "Hello World";
var_dump($text, $binary, $hello);
print "\n";
$trimmed = ltrim($text);
var_dump($trimmed);
$trimmed = ltrim($text, " \t.");
var_dump($trimmed);
$trimmed = ltrim($hello, "Hdle");
var_dump($trimmed);
// 删锟斤拷 $binary 锟斤拷头锟斤拷 ASCII 锟斤拷锟斤拷锟街凤拷
// (锟斤拷 0 锟斤拷 31锟斤拷锟斤拷锟斤拷 0 锟斤拷 31)
$clean = ltrim($binary, "\x00..\x1F");
var_dump($clean);
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
string(32) " These are a few words :) ... " string(16) " Example string " string(11) "Hello World" string(30) "These are a few words :) ... " string(30) "These are a few words :) ... " string(7) "o World" string(15) "Example string "