[ create a new paste ] login | about

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

PHP, pasted on Apr 7:
1
2
3
4
5
6
7
8
9
10
<?php

    $array = array(1, 2, 3, 4, 5);

    foreach ($array as $item) {
      echo "$item\n";
      $array[] = $item;
    }

    print_r($array);


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1
2
3
4
5
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
    [5] => 1
    [6] => 2
    [7] => 3
    [8] => 4
    [9] => 5
)


Create a new paste based on this one


Comments: