php数组随机排序

杂七杂八 3154 Views 0 Comments

php数组随机排序

<?php
$php = array("a","b","c","d","e");
shuffle($php);
print_r($php);
?>

结果: Array ( [0] => c [1] => e [2] => a [3] => d => b )

这样每次输出的结果都会是随机的

标签: PHP,

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
loading