#natcasesort array function
Explore tagged Tumblr posts
decodewebin · 6 years ago
Photo
Tumblr media
What is natcasesort() function in php ?
You have used sort() or other sorting functions in php but natcasesort() function works a little bit differently. natcasesort() sorts an array elements as if we, human sort things lexicographically. Here therefore, case does not matter.
Source: https://decodeweb.in/php/10-not-so-famous-but-powerful-array-helper-functions-in-php/#10-natcasesort
0 notes
protechstack · 4 years ago
Text
How to sort an array in Php
Sort functions:
sort() – sort in ascending order.
rsort() – sort in descending order.
asort() – sort in ascending order while preserving key-value association.
natsort() – natural order sorting in ascending order.
natcasesort() – sort an array using case-insensitive “natural order”
ksort() – sort an array in ascending order using key
krsort() – sort an array in defending order using key
check this out to learn about sorting in more detail with example - https://protechstack.com/sort-an-array-in-php/
0 notes