PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I need to pair them up. So I'll have 5 total pairs out of that array. What's the best way to do that?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
<?php
//array of all participants
$participants = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
//random number to shuffle
$rand = mt_rand(10, 100);
//shuffle $rand times
for($i=0; $i<$rand; $i++)
{
shuffle($participants);
}
//make pairs
$pairs = array_chunk($participants, 2);
//list pairs
foreach($pairs AS $pair)
{
echo '<p>'.$pair[0].'<br />'.$pair[1].'</p>';
}
?>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I figured it was like a deck of cards. When you first open them up, they're in order. Shuffle once and they'll be randomized, but some still in order.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.