Gen. partnerAlgotech

PHP function usort()

Sort an array by values using a user-defined comparison function

|
September 11, 2019

Availability in PHP 4.0

Sort an array by values using a user-defined comparison function

Parameters

Parameter Data type Default value Note
$array array not The input array.
$cmp_function callback not The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Return values

bool

Returns true on success, otherwise false on failure.

Other resources

Official usort documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.