cocur/chain

Implement natcasesort

nreynis opened this issue · 1 comments

This would also be a great addition:
http://php.net/manual/fr/function.natcasesort.php

I'm not sure what's best:

  • implementing it as a method
  • making it an option of the existing sort method

Also you may also consider other case insensitive operations like a CI unique and intersect.

While natsort() and natcasesort() are not directly implemented in Chain, it is already possible to achieve the same result with the $sortBy argument:

$chain->sort(SORT_NATURAL | SORT_FLAG_CASE); // natcasesort()
$chain->sort(SORT_NATURAL); // natsort()