Search

Showing 7 of 1,216 result(s)

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-the-sortnumeric-flag

The SORT_NUMERIC treats each item as a number when doing the comparison. The following code example shows how to use the SORT_NUMERIC flag when sorting the $collection created previously (the callback function will return the string representation...

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-the-sortstring-flag

The SORT_STRING treats each item as a string when doing the comparison. The following code example shows how to use the SORT_STRING flag when sorting the $collection created previously (the callback function will return the string representation...

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-sortstring-and-sortflagcase-flags-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/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-the-sortlocalestring-flag

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/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-the-sortnatural-flag

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/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-the-sortnatural-and-sortflagcase-flags-for-case-insensitivity

The SORT_FLAG_CASE flag can be combined with the SORT_NATURAL 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_NATURAL with the SORT_FLAG_CASE flag when sorting the...

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-based-on-a-key-value-with-sortby#content-using-sortby-with-higher-order-messages

In the following example, we will use the sortBy with higher order messages, which allows us to invoke certain collection methods using PHP's property accessors syntax. To start, we will create a new PeripheralDevice class which will simply hold...

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.