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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
| <?php
$arr = array(3,2,9,6,4,1,0);
echo '<pre>';
sort($arr);
print_r($arr);
<!-- more -->
shuffle($arr);
print_r($arr);
echo '<hr>';
$arr1 = array('wnagyu',15,'hui',5,9,3,1);
echo current($arr1),'<br>';
echo key($arr1),'<br>';
echo next($arr1),next($arr1),'<br>';
echo prev($arr1),'<br>';
echo key($arr1),'<br>';
echo '<pre>';
print_r($arr1);
echo '<hr>';
echo end($arr1),'<br>';
echo reset($arr1),'<br>';
$arr2 = array('tg',5,'po',1,3,9,12,56);
array_push($arr2,45);
echo '<pre>';
print_r($arr2);
array_pop($arr2);
echo '<pre>';
print_r($arr2);
$arr3 = [1,3,6,9,15,8];
echo '<pre>';
print_r(array_reverse($arr3));
var_dump(in_array(1,$arr3));
var_dump(in_array(123,$arr3));
print_r(array_keys($arr3));
print_r(array_values($arr3));
|