我有这个例如:
$array['one'][0] = 0;
$array['one'][1] = 1;
$array['one'][2] = 2;
$array['one'][3] = 3;
$array['two'][0] = 00;
$array['two'][1] = 11;
$array['two'][2] = 22;
$array['two'][3] = 33;
我怎样才能将它们都洗牌以获得类似的东西:
$array['one'][0] = 2;
$array['one'][1] = 1;
$array['one'][2] = 3;
$array['one'][3] = 0;
$array['two'][0] = 22;
$array['two'][1] = 11;
$array['two'][2] = 33;
$array['two'][3] = 00;
或任何其他随机顺序,但两者具有相同的“随机因子”?
例如,我想要那个$array['one'][0]
并且$array['two'][0]
被洗牌以获得$array['one'][x]
和$array['two'][x]
(x
是一个随机键,但两个数组上的相同)。