Skip to content

Instantly share code, notes, and snippets.

@slopjong
Created July 12, 2015 12:15
Show Gist options
  • Save slopjong/5a05290755674c475711 to your computer and use it in GitHub Desktop.
Save slopjong/5a05290755674c475711 to your computer and use it in GitHub Desktop.
<?php
$winners = array(
array(
array(8, 17, 21, 31, 34),
array(9, 10),
),
array(
array(29, 30, 32, 34, 46),
array(3, 6),
),
array(
array(15, 33, 41, 44, 47),
array(8, 10),
),
array(
array(6, 29, 30, 38, 45),
array(1, 8),
),
array(
array(5, 10, 31, 33, 40),
array(8, 10),
),
array(
array(9, 13, 15, 19, 24),
array(3, 8),
),
array(
array(17, 31, 33, 44, 50),
array(7, 11),
),
array(
array(10, 26, 30, 39, 50),
array(7, 8),
),
array(
array(13, 17, 20, 30, 45),
array(9, 10),
),
array(
array(12, 24, 39, 42, 44),
array(3, 11),
),
array(
array(2, 5, 18, 30, 43),
array(1, 10),
),
array(
array(4, 10, 14, 37, 46),
array(4, 7),
),
array(
array(3, 25, 28, 34, 50),
array(1, 11),
),
array(
array(5, 14, 17, 25, 47),
array(9, 10),
),
array(
array(6, 8, 11, 13, 21),
array(7, 8),
),
array(
array(23, 30, 47, 49, 50),
array(2, 7),
),
array(
array(2, 6, 23, 30, 31),
array(2, 10),
),
array(
array(4, 5, 18, 22, 23),
array(1, 3),
),
array(
array(11, 23, 26, 38, 44),
array(1, 8),
),
);
$myNumbers = array(
array(
array(1, 10, 16, 31, 36),
array(4, 5),
),
array(
array(3, 13, 27, 37, 39),
array(4, 8),
),
array(
array(11, 15, 25, 32, 48),
array(8, 9),
),
array(
array(22, 31, 34, 42, 44),
array(3, 5),
),
array(
array(1, 15, 32, 36, 50),
array(5, 9),
),
array(
array(14, 20, 21, 35, 44),
array(2, 3),
),
array(
array(19, 23, 32, 37, 41),
array(2, 5),
),
);
foreach ($myNumbers as $myNumber) {
foreach ($winners as $winner) {
$numbers = array_intersect($myNumber[0], $winner[0]);
$stars = array_intersect($myNumber[1], $winner[1]);
$amount = count($numbers);
if ($amount >= 2) {
echo $amount;
if (count($stars) > 0) {
echo ' - ' . count($stars);
}
echo PHP_EOL;
}
}
}
echo '----------------------' . PHP_EOL;
echo count($winners);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment