[ create a new paste ] login | about

Link: http://codepad.org/mUPnYsRE    [ raw code | output | fork ]

PHP, pasted on May 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// initial value

$week = 50;
$year = 2001;
$store = array();
do
  {
  $week++;
  $result = "$week/$year"; echo "$result\n";
  array_push($store, $result);
  if($week == 53){
    $week = 0;
    $year++;//increment year by 1
    }
    continue;
  }
// End of Loop
while ($result !== "2/2002");

?>


Output:
1
2
3
4
5
51/2001
52/2001
53/2001
1/2002
2/2002


Create a new paste based on this one


Comments: