String manipulation function 3

Source: Internet
Author: User

1. String substitution functionStr_replace () replaces a string or array element, is case-sensitive, and the 4th parameter is optional for statistical        The number of replacements.      Str_ireplace () case- insensitive         STRTR () replaces any character in a string2. String comparison functionstrcmp () compares strings if equal returns 0 if the string 1< string 2 returns 1 otherwise returns 1
strcasecmp () case insensitive string comparison
strnatcmp () compare by natural number
strncmp () specifying the number of digits for string comparisons
Similar_text () compares how many characters are equal for two strings, and the third parameter returns a variable that is a percentage similar to the 2 string
3. String statistic function    Substr_count () to find the number of occurrences of a string in another string, you can specify the starting lookup location for the lookup length.
  


From for notes (Wiz)

String manipulation function 3

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.