mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document comparison ignoring diacritics and case sensitivity
This commit is contained in:
parent
2b2edac59b
commit
7f6b41f74c
1 changed files with 27 additions and 0 deletions
|
@ -127,6 +127,33 @@ if ($res === false) {
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Comparing strings without diacritics or case-sensitivy</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$c = new Collator( 'en' );
|
||||
$c->setStrength( Collator::PRIMARY );
|
||||
|
||||
if ( $c->compare( 'Séan', 'Sean' ) == 0 )
|
||||
{
|
||||
echo "The same\n";
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
The same
|
||||
</screen>
|
||||
<para>
|
||||
This example instructs the collator to compare with only taking the base
|
||||
characters into account. The documentation for
|
||||
<function>Collator->setStrength</function> explains the different
|
||||
strengths.
|
||||
</para>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
|
Loading…
Reference in a new issue