[ create a new paste ] login | about

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

PHP, pasted on Oct 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?
$array = array(
             0 => 'aaa',
             1 => 'bbb',
             2 => 'ccc',
             3 => 'ddd'
            );

    for($i = count($array); $i>0; $i--){
        $newArry[] = implode($array);
        unset($array[$i-1]);
    }

    print_r($newArry);
?>


Output:
1
2
3
4
5
6
7
Array
(
    [0] => aaabbbcccddd
    [1] => aaabbbccc
    [2] => aaabbb
    [3] => aaa
)


Create a new paste based on this one


Comments: