Analysis of PHP stripos () Functions and precautions

Source: Internet
Author: User

Definition and usage
The stripos () function returns the position where the string first appears in another string.

If this string is not found, false is returned.

Syntax
Stripos (string, find, start)

Parameters Description
String Required. Specifies the string to be searched.
Find Required. Specifies the characters to be searched.
Start Optional. Specifies the location where the search starts.

Tips and comments
Note: This function is case insensitive. To perform a case-sensitive search, use the strpos () function.
This function returns the position of the first occurrence of the string in another string. So this location may be 0.
When the return value is 0, you must note that
Copy codeThe Code is as follows:
If (stripos ($ r, 'A') = false ){

// 0 indicates that a exists in total with $ r, but because 0 and false are equal, the following code is executed:
}
If (stripos ($ r, 'A') == false ){

// In this case, we must use all equal values.

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.