Function __global->_strlen_reverse_sort

Definitions

sources/global3.php

  • Helper function for usort to sort a list by string length in reverse order.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$a mixed No No required parameter N/A N/A The first string or array of strings to compare
$b mixed No No required parameter N/A N/A The second string or array of strings to compare

Returns

  • The comparison result (0 for equal, -1 for less, 1 for more)
  • Type: integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Helper function for usort to sort a list by string length in reverse order.
 *
 * @param  mixed $a The first string or array of strings to compare
 * @param  mixed $b The second string or array of strings to compare
 * @return integer The comparison result (0 for equal, -1 for less, 1 for more)
 */

function _strlen_reverse_sort($a, $b) : int