Php array sorting sort problem.

has the following array: $arr = ["abc"," ABC", 0.23, "Begin"," oh", 11,456, "sort"," EMAIL"] ;

Why is it sorted using sort ($arr), sort ($arr, SORT_STRING), sort ($arr, SORT_NUMERIC) respectively?

["ABC","Begin","EMAIL","abc","oh","sort",0.23,11,456]

["abc","ABC","Begin","oh","sort","EMAIL",0.23,11,456]

[0.23,11,456,"ABC","Begin","EMAIL","abc","oh","sort"]
Mar.02,2021

is just the difference between sorting algorithms alphabetically and numerically. Strings can be arranged as an array of numbers in C.

PHP documents are really the best written and easiest to read in all languages. Take a look at them. There is no such treatment for learning other languages. sort

Menu