If you also get the key, you can delete that item like this:
foreach ($display_related_tags as $key => $tag_name) {
if($tag_name == $found_tag['name']) {
unset($display_related_tags[$key]);
}
}
More Related Contents:
- case-insensitive array_unique
- How to make array inside in foreach loop – php? [closed]
- Can't echo items from array
- How does PHP ‘foreach’ actually work?
- Two arrays in foreach loop
- Modify array values in foreach loop
- PHP foreach change original array values [duplicate]
- PHP How to determine the first and last iteration in a foreach loop?
- What is the best way to loop through this array in PHP?
- How can I loop through two arrays at once? [duplicate]
- How to find the foreach index?
- How to access mysql result set data with a foreach loop
- Strange behavior of foreach when using reference: foreach ($a as &$v) { … }
- PHP foreach with Nested Array?
- PHP hierarchical array – Parents and childs
- Looping a multidimensional array in php
- What is better in a foreach loop… using the & symbol or reassigning based on key?
- Unsetting array values in a foreach loop [duplicate]
- How to access first level keys of a 2d array with a foreach loop? [duplicate]
- PHP: Get the key from an array in a foreach loop [duplicate]
- Removing last comma from a foreach loop
- PHP foreach loop through multidimensional array [duplicate]
- Loop a multidimensional array and only print two specific column values per row
- Multiple index variables in PHP foreach loop
- Insert elements from one array (one-at-a-time) after every second element of another array (un-even zippering)
- php multidimensional array get values
- endforeach in loops?
- foreach with three variables add
- PHP array printing using a loop
- Twig for loop for arrays with keys