|
Free
PHP Tutorials
|
![]() |
home |
Stay
at Home and Learn
|
|||||
similar_text( ) |
||||||
|
As it's name suggests, tells you how similar two strings of text are. The syntax is: similar_text($string1, $string2, $percent) The first two are the strings you want to compare. The percent tells you how accurate, in percentage terms, the match was. This is optional, though, so you can leave it out. Here's an example that tells the user how accurately they entered a username: $real_username ="Bill Gates"; $check = similar_text($real_username, $user_attempt, $percent); print($check) . "<BR>"; The above script will print out the following: 9 The blank space is counted as a character.
|