From fd7773589d6e41c4657dcf6614c4eeddb1fd87b0 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sat, 3 May 2025 15:02:25 +0100 Subject: [PATCH 1/3] strcmp: Improve behavior description and direct users to alternative functions (strcoll and Collator::compare) where appropriate; Add the "similarity" functions to seealso Removed substr from seealso (why is it here?) --- reference/strings/functions/strcmp.xml | 41 ++++++++++++++++++++------ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/reference/strings/functions/strcmp.xml b/reference/strings/functions/strcmp.xml index f34c127bf74f..3767927e7112 100644 --- a/reference/strings/functions/strcmp.xml +++ b/reference/strings/functions/strcmp.xml @@ -14,7 +14,10 @@ stringstring2 - Note that this comparison is case sensitive. + Note that this comparison is case sensitive. See strcasecmp + + + Note that this comparison is not locale aware. See strcoll or Collator::compare @@ -87,14 +90,34 @@ if (strcmp($var1, $var2) !== 0) { &reftitle.seealso; - - strcasecmp - preg_match - substr_compare - strncmp - strstr - substr - + + + Full string comparison + + strcasecmp + Collator::compare + strcoll + + + + Partial string comparison + + substr_compare + strncmp + strstr + + + + Similar / other string comparison + + preg_match + levenshtein + metaphone + similar_text + soundex + + + From a484399869fe22755b7a31d1f5cf2bd34127d4c8 Mon Sep 17 00:00:00 2001 From: AllenJB Date: Sat, 3 May 2025 15:06:53 +0100 Subject: [PATCH 2/3] Cross-link all the string similarity functions --- reference/strings/functions/metaphone.xml | 10 ++++++++++ reference/strings/functions/similar-text.xml | 1 + 2 files changed, 11 insertions(+) diff --git a/reference/strings/functions/metaphone.xml b/reference/strings/functions/metaphone.xml index f9a10da1de5b..4e420f9ac8f5 100644 --- a/reference/strings/functions/metaphone.xml +++ b/reference/strings/functions/metaphone.xml @@ -155,6 +155,16 @@ string(6) "ASTRKS" + + &reftitle.seealso; + + + levenshtein + similar_text + soundex + + +