In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The editor will share with you how to remove the second character from the php string. I hope you will get something after reading this article. Let's discuss it together.
In php, you can use the substr_replace () function to remove the second character from the string, just use this function to replace the second character with the empty character "''", syntax "substr_replace ($str,'', 1p1)".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can use the substr_replace () function to remove the second character from the string.
The substr_replace () function is a replacement function that replaces characters of a specified length, starting at a specified location.
Syntax:
Mixed substr_replace (mixed $string, mixed $replacement, mixed $start [, mixed $length])
Substr_replace () replaces the substrings qualified by the start and optional length parameters with replacement in the copy of the string string.
If start is positive, the replacement starts at the start position of the string. If the start is negative, the replacement starts at the penultimate start of the string.
If the length parameter is set and is a positive number, it indicates the length of the substring to be replaced in the string. If set to a negative number, it indicates the number of characters at the end of the substring to be replaced from the end of the string. If this parameter is not provided, it defaults to strlen (string) (the length of the string). Of course, if length is 0, then the function of this function is to insert replacement into the start location of the string.
To remove only the second character, just set start and length to 1 and replacements to the empty character "'".
After reading this article, I believe you have a certain understanding of "how to remove the second character from the php string". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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: 269
*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.