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.

Continue your learning journey with a 14-day free trial.

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