I have an array created by explode() function, so keys are basically 0, 1, 2, 3... And all array values are integers, like 1, 45, 12, 845...
I need to pop out an item which has a value of, for example, 12. Also, if there are multiple items with same value, only one of them should be poped out.
Code: Select all
$array = Array (
0 => 1,
1 => 12,
2 => 12,
3 => 45,
4 => 124 )
$item = 12;
// I need to delete one item with value $item from array $array