/hphp/test/slow/array_object/natcasesort.php
PHP | 21 lines | 17 code | 4 blank | 0 comment | 0 complexity | ef96e6264339147f0eb87577f5c07fd8 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- $array = array(
- 'IMG0.png',
- 'img12.png',
- 'img10.png',
- 'img2.png',
- 'img1.png',
- 'IMG3.png'
- );
- $arr1 = new ArrayObject($array);
- $arr2 = clone $arr1;
- $arr1->asort();
- echo "Standard sorting\n";
- print_r($arr1);
- $arr2->natcasesort();
- echo "\nNatural order sorting (case-insensitive)\n";
- print_r($arr2);