How to remove the first character of string in PHP

The substr() function is the good solution:

$NewString = substr($OldString, 1);

Strings are indexed starting from 0, and substr() functions will start from second parameter to store new value into into variable.

So the first character of your string will not present into the NewString variable.

Please follow and like us:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.