How to remove the first character of string in PHP?

后端 未结 13 2307
一整个雨季
一整个雨季 2020-12-02 06:00
$str=\':this is a applepie :) \';

How to use PHP, Remove the first character :

13条回答
  •  甜味超标
    2020-12-02 06:23

    To remove every : from the beginning of a string, you can use ltrim:

    $str = '::f:o:';
    $str = ltrim($str, ':');
    var_dump($str); //=> 'f:o:'
    

提交回复
热议问题