Delete an element from an array in PHP

Delete one array element

If you want to delete just one array element you can use unset()

unset() method

Note that when you use unset() the array keys won’t change/reindex. If you want to reindex the keys you can use afterarray_values()unset() which will convert all keys to numerical enumerated keys starting from 0.

Code

Output

0 Comments

No Comment.