-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex6.php
46 lines (44 loc) · 1.06 KB
/
ex6.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
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$arr = ['oreo','rio','dio','leo','amigo',10,11];
$number = [12,23,33,2,9,10,11];
$person = [
'name'=> 'giga',
'age'=> 'billion',
'address'=> 'InTechno',
];
// echo '<pre>';
// sort($arr);
// for( $i = 0; $i < count($arr); $i++ )
// // var_dump(sort($arr));
// {
// echo $arr[$i];
// echo "<br>";
// }
// rsort($number); //reverse sorting
// for( $i = 0; $i < count($number); $i++ )
// // var_dump(sort($number));
// {
// echo $number[$i];
// echo "<br>";
// }
//only for associated array
// asort($person); //value ascending
// ksort( $person );//key descending
//arsort => value descending
//krsort => key descending
// echo "<pre>";
// var_dump($person);
shuffle( $arr );
echo '<pre>';
var_dump( $arr);
?>
</body>
</html>