0% found this document useful (0 votes)
4 views3 pages

PHP Array Sorting Techniques

The document provides an overview of array sorting in PHP, including examples of sorting an array of names in ascending, descending, and reverse order. It lists various PHP functions for sorting arrays such as sort, rsort, arsort, asort, krsort, ksort, and array_reverse. These functions allow for different sorting methods based on the requirements of the programmer.

Uploaded by

ahmaderfanroshan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

PHP Array Sorting Techniques

The document provides an overview of array sorting in PHP, including examples of sorting an array of names in ascending, descending, and reverse order. It lists various PHP functions for sorting arrays such as sort, rsort, arsort, asort, krsort, ksort, and array_reverse. These functions allow for different sorting methods based on the requirements of the programmer.

Uploaded by

ahmaderfanroshan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

‫پښﺘﻮ‬ PHP

Array Sorting
PHP Array: Sorting:

$a = [‘Ahmad’, ‘Jawad’, ‘Karim’, ‘Bilal’, ‘Jamil’]


Ahmad, Bilal, Jamil, Jawad, Karim Ascending
‫پښﺘﻮ‬ Karim, Jawad, Jamil, Bilal, Ahmad Descending

Jamil, Bilal, Karim, Jawad, Ahmad Reverse


PHP Array: Sorting:

• sort
• rsort
• arsort

‫پښﺘﻮ‬ • asort
• krsort
• ksort
• array_reverse

You might also like