-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnatsort.php
33 lines (33 loc) · 912 Bytes
/
natsort.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>natsort function</title>
<style>
<!--
body{
font-family: Verdana,Arial,Helvetica, sans-serif;
font-weight: normal;
background-color: #dddddd;
}
-->
</style>
</head>
<body>
<?php
$array1 = $array2 = array("cat12.jpg","cat10.jpg","cat2.jpg","cat1.jpg");
asort($array1);
echo "Standard sorting \n";
print_r($array1);
echo "<hr>";
echo "<br>";
natsort($array2);
echo "\nNatural order sorting in a human being would\n";
echo "<hr>";
print_r($array2);
echo "<hr>";
?>
</body>
</html>