&reftitle.examples; Random の例 getBytesFromString('abcdefghijklmnopqrstuvwxyz0123456789', 16) ); // 配列をシャッフルする: $fruits = [ 'red' => '🍎', 'green' => '🥝', 'yellow' => '🍌', 'pink' => '🍑', 'purple' => '🍇' ]; echo "Salad: ", implode(', ', $r->shuffleArray($fruits)), "\n"; // 配列のキーをシャッフルする $fruits = [ 'red' => '🍎', 'green' => '🥝', 'yellow' => '🍌', 'pink' => '🍑', 'purple' => '🍇' ]; $keys = $r->pickArrayKeys($fruits, 2); // 選択したキーの値を調べる $selection = array_map( static fn ($key) => $fruits[$key], $keys ); echo "Values: ", implode(', ', $selection), "\n"; ?> ]]> &example.outputs.similar;