From 7f6b41f74ca63f670ec25b3eba2efc00dd9f8a63 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 6 Aug 2021 17:32:19 +0100 Subject: [PATCH] Document comparison ignoring diacritics and case sensitivity --- reference/intl/collator/compare.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/reference/intl/collator/compare.xml b/reference/intl/collator/compare.xml index 234517bda8..e588f94d9e 100644 --- a/reference/intl/collator/compare.xml +++ b/reference/intl/collator/compare.xml @@ -127,6 +127,33 @@ if ($res === false) { + + + Comparing strings without diacritics or case-sensitivy + +setStrength( Collator::PRIMARY ); + +if ( $c->compare( 'Séan', 'Sean' ) == 0 ) +{ + echo "The same\n"; +} +]]> + + &example.outputs; + + The same + + + This example instructs the collator to compare with only taking the base + characters into account. The documentation for + Collator->setStrength explains the different + strengths. + + +