php8.5
Home/ Manual/ intl / collator/ Collator::getAttribute

Collator::getAttribute

PHP function Edit on GitHub ✎

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

Get collation attribute value

Description

Oop

Collator::getAttribute(int $attribute): int|false

Procedural

collator_get_attribute(Collator $object, int $attribute): int|false

Get a value of an integer collator attribute.

Parameters

object

Collator object.

attribute

Attribute to get value for.

Return Values

Attribute value,Falseforfailure.

Examples

collator_get_attribute() example

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

See Also

Source: reference/intl/collator/get-attribute.xml · from the official PHP manual (php/doc-en)