1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class MyCongrats
{
    protected $dayX = 1;
 
    public function __construct() 
    {
        $this->dayX <<=  8; // pow(2, 8) == 256
        $this->dayX--;      // as date() starts from zero
    }
 
    public function fireCongtats()
    {
        if (date('z') == $this->dayX) {
            printf('<a href="%s">С праздником</a>', 
                    'http://ru.wikipedia.org/wiki/День программиста');
        }
    }
}
 
$obj = new MyCongrats();
$obj->fireCongtats();
    Trackback

    no comment untill now

    Add your comment now