<p>I think questions like this are the reason why I don't like working with PHP. The manual is good, if you can find what you are looking for. After reading through the <a href="http://us3.php.net/array" rel="nofollow noreferrer">Array Functions</a>, I didn't see one that provides the functionality I need.</p>

<p>I have an array (in my case, numerically indexed) that I want to scan for a particular value and, if it's there, remove it. And then, when all instances of that value have been removed, I want to rearrange the array using <a href="http://us3.php.net/manual/en/function.array-values.php" rel="nofollow noreferrer">array_values</a>.</p>

```
array_diff
```
is what you want.
```
```
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
```
```
Result:
```
"blue"
```
.