[ create a new paste ] login | about

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

PHP, pasted on Jun 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

$array = array(a,s,d,f,g,h,j,k,l);

foreach($array as $i => &$a){
 foreach($array as $k => &$b){
    if($k == 4){
     unset( $b);
    }
 }
 
 echo $a . "\n";
}

print_r($array);


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
a
s
d
f
g
h
j
k
l
Array
(
    [0] => a
    [1] => s
    [2] => d
    [3] => f
    [4] => g
    [5] => h
    [6] => j
    [7] => k
    [8] => l
)


Create a new paste based on this one


Comments: