In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how php replaces the third character of a string. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
In php, you can use the substr_replace () function to replace the third character of a specified string, which can replace a character of a specified length starting at a specified position in the string; the syntax is "substr_replace (string," replacement value ", 2j 1)".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can use the substr_replace () function to replace the third character of a specified string.
Example:
Description:
The substr_replace () function replaces part of a string with another string.
The substr_replace () function can replace characters of a specified length, starting at a specified position in a string.
Syntax:
The substr_replace (string,replacement,start,length) parameter is required to describe string. Specifies the string to check. Replacement is required. Specifies the string to insert. Start is required. Specifies where to start the replacement of the string.
Positive number-starts at the specified position of the string
Negative number-starts at the specified position at the end of the string
0-starts at the first character in the string
Length is optional. Specifies how many characters to replace. The default is the same length as the string.
Positive number-the length of the string being replaced
Negative number-the number of characters replaced from the end of the string
0-insert instead of replace
Return value: returns the string to be replaced. If string is an array, an array is returned.
Thank you for reading! This is the end of this article on "how to replace the third character of a string by php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.