/hphp/test/slow/array_object/natsort.php
PHP | 14 lines | 10 code | 4 blank | 0 comment | 0 complexity | d742beb07ad17a1a8bd8a9538fe3ec38 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("img12.png", "img10.png", "img2.png", "img1.png");
- $arr1 = new ArrayObject($array);
- $arr2 = clone $arr1;
- $arr1->asort();
- echo "Standard sorting\n";
- print_r($arr1);
- $arr2->natsort();
- echo "\nNatural order sorting\n";
- print_r($arr2);