Home > Article > Backend Development > How to delete the first character in php
#How to delete the first character in php?
php uses the substr() function to delete the first character.
substr('string',1);
Delete the last character of the string
substr('string', 0, -1);
Syntax: substr(string,start,length)
Note: If the start parameter is a negative number and length is less than or equal to start, length is 0.
Recommended tutorial: "php tutorial"
The above is the detailed content of How to delete the first character in php. For more information, please follow other related articles on the PHP Chinese website!