Home / PHP Tips Generated By ChatGPT / Shuffling an Array in PHP Randomize the order of elements in an array with shuffle(). Source Code $cards = range(1, 10); shuffle($cards); print_r($cards); // Outputs the elements in a random order