Home >Backend Development >PHP Problem >How to delete the first character in php

How to delete the first character in php

hzc
hzcOriginal
2020-06-19 17:00:352763browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn