Quantcast
Channel: Adam Zwakk
Viewing all articles
Browse latest Browse all 10

Snippet: Remove item from Array in PHP

$
0
0

To find the string ‘foo’ inside the array $array and remove it, you can do this.

unset($array[array_search('foo', $array)]);

Viewing all articles
Browse latest Browse all 10

Trending Articles