Sorting Arrays

Sorting Indexed Arrays #

By Value #

sort() #

sort() is a built-in function in PHP that can be used to sort arrays in ascending order., in ascending order, by value. The associated keys are not preserved during this. Run the code below to see an example of sort().

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy