PHP - How to delete a element from an ARRAY

preview_player
Показать описание
There are different ways to delete an array element, where some are more useful for some specific tasks than others.

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 array_values() after unset() which will convert all keys to numerical enumerated keys starting from 0.
Рекомендации по теме