Voting

: six minus two?
(Example: nine)

The Note You're Voting On

vitospericolato at gmail dot com
9 years ago
To remove elements from an array, based on array values:

<?php
$i_to_remove
=array();

foreach(
$array_to_prune as $i=>$value){
if(
cond_to_delete($value)) $i_to_remove[]=$i;
}
foreach(
$i_to_remove as $j=>$i)
array_splice($array_to_prune,$i-$j,1);

?>

<< Back to user notes page

To Top