fork(1) download
  1. <?php
  2. $a=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  3. for($i=1;$i<=count($a);$i+=2){
  4. unset($a[$i]);
  5. }
  6. print_r($a);
Success #stdin #stdout 0.02s 24364KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 1
    [2] => 3
    [4] => 5
    [6] => 7
    [8] => 9
    [9] => 10
)