Question:What are the different functions in sorting an array? Discuss them?

 

Answer array_reverse():    reverses an array’s element order.

array_flip(): reverses the roles of the keys and their corresponding values.
    
sort(): sorts an array, ordering elements from lowest to highest value.

rsort(): sorts array items in reverse (descending) order.

asort() : sorting an array in ascending order, except that the key/value correspondence is maintained.

arsort(): it sorts the array in reverse order maintained key/value co-relation.

 


Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in D:\webserver\www\vcampusbd.com\answers\column_answer_two.php on line 128
+ Report
Total Preview: 914
What are the different functions in sorting an array? Discuss them?

Copyright © 2024. Powered by Intellect Software Ltd