The krsort() function in PHP sorts an associative array in ascending order based on its keys.

  • FALSE
  • TRUE
The correct option is 2. The krsort() function in PHP sorts an associative array in descending order based on its keys, not in ascending order. It rearranges the elements of the array in such a way that the keys are sorted in descending order while maintaining the association between keys and values. The krsort() function directly modifies the original associative array. Sorting an associative array by keys in ascending order can be achieved using the ksort() function. Learn more: https://www.php.net/manual/en/function.krsort.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *