PHP remove specific item from array
<p>I have an array like : <code>[312, 401, 1599, 3]</code></p>

<p>With <code>array_diff( [312, 401, 1599, 3], [401] )</code> I can remove a value, in my example I removed the value 401.</p>

<p>But if I have this : [312, 401, 401, 401, 1599, 3], how can remove just one time the value 401 ?</p>

<p>It is not important if I remove the first or last value, I just need to remove ONE 401 value, and if I want to remove all 401 values, I have to remove three times.</p>

<p>Thanks !</p>