PHP/Data Structure/array chunk — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 10:02, 26 мая 2010

array_chunk

   <source lang="html4strict">

<?php $cards = array("jh","js","jd","jc","qh","qs","qd"); // shuffle the cards shuffle($cards); // Use array_chunk() to divide the cards into four equal "hands" $hands = array_chunk($cards, 4); print_r($hands); ?>

 </source>