Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "Sort number 10, 1, 69 <br/>";
- $numbers=array(10, 1, 69);
- sort($numbers, SORT_NUMERIC);
- foreach($numbers as $value){
- echo $value."<br/>";
- }
- /*
- SORT_REGULAR - compare items normally (don't change types)
- SORT_NUMERIC - compare items numerically
- SORT_STRING - compare items as strings
- SORT_LOCALE_STRING - compare items as strings, based on the current locale.
- It uses the locale, which can be changed using setlocale()
- SORT_NATURAL - compare items as strings using "natural ordering" like natsort()
- SORT_FLAG_CASE - can be combined (bitwise OR) with SORT_STRING or
- SORT_NATURAL to sort strings case-insensitively
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement