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

How to delete the first character in php

hzc
Release: 2023-03-01 16:14:01
Original
2836 people have browsed it

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!

Related labels:
php
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template