Source Code:
(back to article)
<?php $numbers = [1, 2, 3, 4, 5]; for ($i = 0; $i < count($numbers); $i++) { if ($numbers[$i] == 3) { unset($numbers[$i]); } } print_r($numbers); // Array ( [0] => 1 [1] => 2 [3] => 4 [4] => 5 )
Result:
Report an issue