I have an array that looks like this:
Array
(
[0] => Array
(
[Title] => Super Widget
)
[1] => Array
(
[Title] => Amazing Widget
)
[2] => Array
(
[Title] => Even more amazing widget
)
)
How would I remove The Array at spot [1] for example? and I suppose it would have to move the array in spot [2] up to spot [1].
Thanks for any help.
To remove an element given its key, use
In your case,
$keywould be1.This will leave a “hole” in the sequence of keys. You can perform an automatic reindexing of your array to get rid of that hole with