PHP | Collator create() Function Last Updated : 30 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Collator::create() function is an inbuilt function in PHP which is used to create a new collector. Syntax: Object oriented style: Collator Collator::create( $locale ) Procedural style: Collator collator_create( $locale ) Parameters: This function accepts single parameter $locale which holds the required collation rules. If a null value is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed in the locale then UCA rules will be used. Return Value: This function return the new instance of collator object on success, or NULL on error. Below programs illustrate the Collator::create() function in PHP: Program 1: php <?php $coll = collator_create( 'en_US' ); if(isset($coll)){ echo "Collector created"; } else { echo "Collector not created"; } ?> Output: Collector created Program 2: php <?php $coll = collator_create( 'en_US' ); // Declare array and initialize it $arr = array( 'geek', 'geeK', 'Geek', 'geeks' ); // Sort array collator_sort( $coll, $arr ); // Display array content var_export( $arr ); ?> Output: array ( 0 => 'geek', 1 => 'geeK', 2 => 'Geek', 3 => 'geeks', ) Reference: https://www.php.net/manual/en/collator.create.php Create Quiz Comment J jit_t Follow 0 Improve J jit_t Follow 0 Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like