php shuffle() fungsi
Hasil terjemahan:
English [ˈʃʌfl] tunggal: shuffles Plural: shuffles Present participle: shuffling Past tense: shuffled Past participle: shuffled
php shuffle() fungsisintaks
Fungsi: Susun semula elemen dalam tatasusunan dalam susunan rawak:
Sintaks: shuffle(array)
Parameter:
Penjelasan | |
array |
Penjelasan:
php shuffle() fungsicontoh
<?php $a = array("class" => "php中文网","name" => "西门","job" => "讲师"); shuffle($a); print_r($a); ?>e
run Instance »
Klik butang" Run Instance "untuk melihat Instance Online Output:
Array ( [0] => 西门 [1] => php中文网 [2] => 讲师 )e
<?php
$my_array = array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow","e"=>"purple");
shuffle($my_array);
print_r($my_array);
?>
e
Array ( [0] => yellow [1] => green [2] => red [3] => purple [4] => blue )