diff --git a/reference/array/constants.xml b/reference/array/constants.xml index c2a8a4d80b..4fc0998260 100644 --- a/reference/array/constants.xml +++ b/reference/array/constants.xml @@ -111,6 +111,32 @@ + + + SORT_NATURAL + (integer) + + + + SORT_NATURAL is used to compare items as + strings using "natural ordering" like natsort. Added in PHP 5.4.0. + + + + + + SORT_FLAG_CASE + (integer) + + + + SORT_FLAG_CASE can be combined + (bitwise OR) with + SORT_STRING or + SORT_NATURAL to sort strings case-insensitively. Added in PHP 5.4.0. + + + @@ -247,4 +273,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> - diff --git a/reference/array/functions/sort.xml b/reference/array/functions/sort.xml index d73c47d53a..85e2e5d8c2 100644 --- a/reference/array/functions/sort.xml +++ b/reference/array/functions/sort.xml @@ -60,6 +60,17 @@ --> + + SORT_NATURAL - compare items as strings + using "natural ordering" like natsort. Added in + PHP 5.4.0. + + + SORT_FLAG_CASE - can be combined + (bitwise OR) with + SORT_STRING or + SORT_NATURAL to sort strings case-insensitively. Added in PHP 5.4.0. + @@ -105,6 +116,39 @@ fruits[3] = orange The fruits have been sorted in alphabetical order. + + + <function>sort</function> example using case-insensitive natural + ordering + + $val) { + echo "fruits[" . $key . "] = " . $val . "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + The fruits have been sorted like natcasesort. + &reftitle.notes;