How the php string replaces the character after the first character
In this article, Xiaobian introduces in detail how the php string replaces the characters after the first character. The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "php string how to replace the characters behind the first character" can help you solve your doubts.
In php, you can replace the character after the first character with substr_replace (). Just set the third parameter of the function to 1, stipulating that the replacement starts from the second character, and the syntax "substr_replace (string," replacement value ", 1, number of characters)"; if the number of characters is omitted, all characters after that will be replaced.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can replace the character after the first character with substr_replace ().
The substr_replace () function replaces part of a string with another string; it replaces a specified number of characters from the specified position.
Substr_replace (string,replacement,start,length)
Example: replace several characters after the first character
If you omit the number of characters parameter length, all characters after the first character are replaced.
Read this, the "php string how to replace the first character after the character" article has been introduced, want to master the knowledge of this article still need to practice and use to understand, if you want to know more about the article, welcome to follow the industry information channel.