foreach($array as $elementKey => $element) {
foreach($element as $valueKey => $value) {
if($valueKey == 'id' && $value == 'searched_value'){
//delete this particular object from the $array
unset($array[$elementKey]);
}
}
}
Related Contents:
- Unsetting array values in a foreach loop [duplicate]
- Deleting an element from an array in PHP
- PHP foreach change original array values [duplicate]
- How do you remove an array element in a foreach loop?
- Performance of FOR vs FOREACH in PHP
- Modify array values in foreach loop [duplicate]
- Two arrays in foreach loop
- How to check if variable is array?… or something array-like
- How to access first level keys of a 2d array with a foreach loop? [duplicate]
- Difference between “as $key => $value” and “as $value” in PHP foreach
- How to access mysql result set data with a foreach loop
- Strange behavior of foreach when using reference: foreach ($a as &$v) { … }
- PHP foreach that returns keys only
- Unexpected behaviour of current() in a foreach loop [duplicate]
- What’s the best way to get the last element of an array without deleting it?
- Invalid argument supplied for foreach()
- Are arrays in PHP copied as value or as reference to new variables, and when passed to functions?
- How to trim white spaces of array values in php
- Access first level keys with array_map() without calling `array_keys()`
- Array copy values to keys in PHP [duplicate]
- PHP Foreach Pass by Reference: Last Element Duplicating? (Bug?) [duplicate]
- How to get random value out of an array?
- Convert stdClass object to array in PHP
- PHP array_filter with arguments
- Passing arrays as url parameter
- laravel collection to array
- Using an array as needles in strpos
- array_unique for objects?
- Prepend associative array elements to an associative array
- Is it necessary to declare PHP array before adding values with []?
- Array of PHP Objects
- Is foreach guaranteed to iterate in the array order in php?
- Array as session variable
- PHP: Get key from array?
- Merge two numerically-keyed associative arrays and preserve the original keys
- PHP – count specific array values
- How can I use in_array if the needle is an array?
- Sorting an associative array in PHP [duplicate]
- Convert a String into an Array of Characters
- PHP Sort array by field? [duplicate]
- POST Variable Array and filter_input
- Move an array element to a new index in PHP
- PHP Multiple Checkbox Array
- array_splice() for associative arrays
- php index of item
- Zig-zag scan an N x N array
- How to create a HTML Table from a PHP array?
- How do I sort a PHP array by an element nested inside? [duplicate]
- what is a good method to sanitize the whole $_POST array in php? [duplicate]
- What is the difference between a generator and an array?