Search

Showing 7 of 1,216 result(s)

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortstring-result-comparison

Option Result Original Order 0 1 2 3 4 5 6 7 8 9 10 11 12 SORT_REGULAR 7 6 3 1 0 5 2 11 10 9 4 8 12 SORT_STRING 7 6 3 1 0 5 2 11 10 9 4 8 12

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortstring-and-sortflagcase-for-case-insensitivity

The SORT_FLAG_CASE flag can be combined with the SORT_STRING flag to treat each item as a string while also ignored the case of each item. The following example shows how to use the SORT_STRING with the SORT_FLAG_CASE flag when sorting the...

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortstring--sortflagcase-result-comparison

Option Result Original Order 0 1 2 3 4 5 6 7 8 9 10 11 12 SORT_STRING 7 6 3 1 0 5 2 11 10 9 4 8 12 SORT_STRING | SORT_FLAG_CASE 7 6 1 0 5 2 11 10 9 4 3 8 12

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortlocalestring

The SORT_LOCALE_STRING treats each item as a string, while also taking into account the current locale, when doing the comparison. The following code example shows how to use the SORT_LOCALE_STRING flag when sorting the $collection created...

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortlocalestring-result-comparison

Option Result Original Order 0 1 2 3 4 5 6 7 8 9 10 11 12 SORT_REGULAR 7 6 3 1 0 5 2 11 10 9 4 8 12 SORT_LOCALE_STRING 7 6 3 1 0 5 2 11 10 9 4 8 12

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortnatural

The SORT_NATURAL treats each item as a string while using a "natural ordering" algorithm to perform the sorting. The following code example shows how to use the SORT_NATURAL flag when sorting the $collection created previously (the callback...

/blog/2016/11/30/laravel-collection-public-api-sortby#content-sortnatural-result-comparison

Option Result Original Order 0 1 2 3 4 5 6 7 8 9 10 11 12 SORT_REGULAR 7 6 3 1 0 5 2 11 10 9 4 8 12 SORT_NATURAL 7 6 3 1 0 5 2 11 10 9 4 8 12