Array shuffle : Array Function : Data Structure PHP Source Code


PHP Source Code » Data Structure » Array Function »

 

Array shuffle



<?php
   $cards = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P");
   // shuffle the cards
   print_r($cards);
   
   print "<BR><BR><BR>";   
   shuffle($cards);
   // Use array_chunk() to divide the cards into four equal "hands"
   $hands = array_chunk($cards, 4);
   print_r($hands);
?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Array Function