The sort() function in PHP sorts an array in ______ order.
- Ascending
- Descending
- Random
- Unspecified
The sort() function in PHP sorts an array in ascending order. It rearranges the elements of an array in such a way that the values go from the smallest to the largest. This function modifies the original array directly, rearranging the elements based on their values. Sorting arrays in ascending order is a common operation in PHP when you need to organize and rearrange array elements. Learn more: https://www.php.net/manual/en/function.sort.php
Loading...
Related Quiz
- Which of the following are true about Regular Expressions in PHP?
- What PHP function can be used to validate an email in a PHP form?
- Which of the following are true about Form Handling in PHP?
- You have an array in your PHP script and you're encountering issues with accessing or manipulating the values. How would you debug this?
- How is it possible to return a value from a function?