Skip to content

Instantly share code, notes, and snippets.

@wowo
Created January 10, 2010 21:27
Show Gist options
  • Save wowo/273781 to your computer and use it in GitHub Desktop.
Save wowo/273781 to your computer and use it in GitHub Desktop.
<?php
/**
* Losowanie liczby w zależności od aktualnego dnia
*/
$days = array(
0 => array(11, 88), //niedziela
1 => array(5, 2), //poniedzialek
2 => array(3, 7), //wtorek
3 => array(2, 9), //sroda
4 => array(55, 22), //czwartek
6 => array(33, 77), //piatek
6 => array(22, 99), //sobota
);
$currentDay = $days[date('w')];
$randomNum = $currentDay[array_rand($currentDay)];
printf("Dzisiejsza losowa liczba to: %d", $randomNum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment