How can a filter out the array entries with an odd or even index number?
Array ( [0] => string1 [1] => string2 [2] => string3 [3] =&
foreach($arr as $key => $value) if($key&1) unset($arr[$key]);
The above removes odd number positions from the array, to remove even number positions, use the following:
Instead if($key&1) you can use if(!($key&1))
if($key&1)
if(!($key&1))