Collator::setAttribute

(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Set collation attribute
public bool Collator::setAttribute ( int $attr, int $val )

Object oriented style

Procedural style

bool collator_set_attribute ( Collator $coll , int $attr , int $val )
Parameters:
coll

Collator object.

attr

Attribute.

val

Attribute value.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
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.
}
?>

See also:

Collator -

collator_get_attribute() -

collator_set_strength() -

doc_php
2016-02-24 15:57:17
Comments
Leave a Comment

Please login to continue.