How to remove the leading character from a string?

The substr() function will probably help you here:

 $str = substr($str, 1);

Strings are indexed starting from 0, and this functions second parameter takes the cutstart. So make that 1, and the first char is gone.

Leave a Comment