Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例子:
$hello = "Hello World"; $trimmed = ltrim($hello, "Hdle"); var_dump($trimmed);
结果:
string(7) "o World"
为什么它没有删除第二个字d?l
d
l
因为你正在使用ltrim,它修剪了左边。只trim修剪两边。
ltrim
trim