In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge about how to find a string in php. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Search method: 1, use strpos (), syntax "strpos (" string value "," find substring ") + 1"; 2, use stripos (), syntax "strpos (" string value "," find substring ") + 1". Because strings are counted from 0, the position obtained by the two functions needs to be added by 1.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In PHP, if you want to find a string, there are two functions that determine which bit it is:
Strpos ()
Stripos ()
Both functions can find where the string first appears, and the syntax is similar:
The strpos (string,find,start) stripos (string,find,start) parameter is required to describe string. Specifies the string to be searched. Find
Necessary. Specifies the characters to look for.
Start is optional. Specify the location to start the search.
Return value: returns the position where the string first appears in another string, or FALSE if the string is not found.
But the strpos () function is case sensitive, while the stripos () function is not case sensitive.
Because strings are counted from 0, the positions obtained by the strpos () and stripos () functions need to be added by 1.
Example 1: use the strpos () function to find out what bit a string is
Example 2: use the stripos () function to find out what bit a string is
These are all the contents of the article "how to find the number of strings in php". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.