已知三个升序整数数组Given an integer array and we have to sort them in ascending and descending order in PHP.给定一个整数数组,我们必须在PHP中按升序和降序对其进行排序。 Methods to sort an array ...
已知三个升序整数数组
Given an integer array and we have to sort them in ascending and descending order in PHP.
给定一个整数数组,我们必须在PHP中按升序和降序对其进行排序。
Methods to sort an array
数组排序方法
In PHP, there are two methods which are used to sort an array,
在PHP中,有两种用于对数组进行排序的方法,
sort() – It is used to sort an array in ascending order.
sort() –用于按升序对数组进行排序。
rsort() – It is used to sort an array in descending order.
rsort() –用于按降序对数组进行排序。
PHP code for sorting array in ascending order
用于按升序对数组排序PHP代码