Phpsimilar_text (), phpsimilar_text_PHP tutorial

Source: Internet
Author: User
Phpsimilar_text (), phpsimilar_text. Phpsimilar_text () and phpsimilar_textphpsimilar_text () functions calculate and compare the similarity between the two strings. This article introduces the basic usage of phpsimilar_text () functions and the basic php similar_text () and phpsimilar_text

The php similar_text () function is used to calculate and compare the similarity between two strings. This article introduces the basic usage and basic use examples of the php similar_text () function to the coders, for more information, see.

Definition and usage

The similar_text () function computes the similarity between two strings.

This function can also calculate the percentage similarity between two strings.

Note: The levenshtein () function is faster than the similar_text () function. However, the similar_text () function provides more accurate results with fewer necessary modifications.

Syntax
similar_text(string1,string2,percent)

  

Parameters Description
String1 Required. Specifies the first string to be compared.
String2 Required. Specifies the second string to be compared.
Percent Optional. Specifies the name of the variable that stores the percentage similarity.

Technical details
Return value: Returns the number of matching characters for two strings.
PHP version: 4 +

Instance

Calculate the percentage similarity between two strings:

 

Online operation

Address: http://www.manongjc.com/article/805.html

Php-related learning:

  • Php operators
  • Php expressions
  • PHP loop control
  • PHP process control
  • Php array
  • Php functions
  • Php global variables
  • PHP magic variable
  • Php namespace

The http://www.bkjia.com/PHPjc/1125678.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1125678.htmlTechArticlephp similar_text (), phpsimilar_text php similar_text () function is used to calculate and compare the similarity between two strings. This article introduces the basic usage and basic of php similar_text () function to the coders...

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.