PHP 8.1.28 Released!

Collator::setAttribute

collator_set_attribute

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

Collator::setAttribute -- collator_set_attributeSet collation attribute

Descrizione

Stile orientato agli oggetti

public Collator::setAttribute(int $attribute, int $value): bool

Stile procedurale

collator_set_attribute(Collator $object, int $attribute, int $value): bool

Elenco dei parametri

object

Collator object.

attribute

Attribute.

value

Attribute value.

Valori restituiti

Restituisce true in caso di successo, false in caso di fallimento.

Esempi

Example #1 collator_set_attribute() example

<?php
$coll
= collator_create( 'en_CA' );
$val = collator_get_attribute( $coll, Collator::NUMERIC_COLLATION );
if (
$val === false) {
// Handle error.
} elseif ($val === Collator::ON) {
// Do something useful.
}
?>

Vedere anche:

add a note

User Contributed Notes 1 note

up
2
galiaf1987 at gmail dot com
9 months ago
//realy example
$collator = new \Collator('en');
$collator->setAttribute(\Collator::NORMALIZATION_MODE, \Collator::ON);
To Top