php ltrim many characters at once

前端 未结 1 819
你的背包
你的背包 2021-01-27 11:20

Hi is there a better and faster way to clean many characters from beginning of a string?

I have this one, but is this really the fastest way?

$descriptio         


        
相关标签:
1条回答
  • 2021-01-27 11:53

    the second parameter can be a charlist:

    $description_new = ltrim($description_new, '#.,!?()');
    

    You could also add a range of characters if it would suit your needs:

    $clean = ltrim($binary, "\x00..\x1F");
    

    Read about: function.ltrim

    0 讨论(0)
提交回复
热议问题