Strpos function, what to do with it

Source: Internet
Author: User
Strpos function
  /> Recommended [C]
Special recommendation of/> [a]
/> Headlines [h]
/> Special recommendation [O]
Special recommendation of/> [n]

I want to judge if $row[' flag ' is c,a,h,o,n one of them. Add a pair of hooks. Why is it that you can only judge the recommended "C"? The back is not showing. Since the first one can succeed, it should be right.
------Solution--------------------
Strpos ($row [' flag '], ' C ')!== false
------Solution--------------------
if (Strpos ($row [' flag '], ' C ')!== false)
Other similar

Strpos returns an integer (no return logical leave found)
' true ' is converted to 0 in a numeric comparison
If the first character of the $row [' flag '] is C, it happens to be matched
The other characters returned are not 0, so the match will not succeed
  • 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.