- strnatcmp: documentation ( source)
- strpos: documentation ( source)
<?php
function buildSorter($key) { return function ($a, $b) use ($key) { return strnatcmp($a[$key], $b[$key]); }; }
function buildFilter($needle) {return function ($haystack) use ($needle) {return strpos($haystack, $needle) !== false; }; }