wc_asort_by_locale( array $data, string $locale = '' )

Sort array according to current locale rules and maintaining index association.


Description Description

By default tries to use Collator from PHP Internationalization Functions if available. If PHP Collator class doesn’t exists it fallback to removing accepts from a array and by sorting with uasort( $data, 'strcmp' ) giving support for ASCII values.


Parameters Parameters

$data

(Required) List of values to sort.

$locale

(Optional) Locale.

Default value: ''


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/wc-core-functions.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.