> For the complete documentation index, see [llms.txt](https://minwork.gitbook.io/array/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minwork.gitbook.io/array/common-methods/remove.md).

# remove

#### Definition

```php
Arr::remove(array $array, $keys): array
```

#### Description

Remove element inside array at path specified by keys.

{% hint style="info" %}
`$keys` argument is parsed using [getKeysArray ](/array/common-methods/getkeysarray.md)method
{% endhint %}

#### Examples

```php
$array = [
    'foo' => [
        1,
        'test' => [
            'abc' => 2,
            'def'
        ],
        [
            'bar' => true
        ],
    ],
];

Arr::remove($array, 'foo') -> []
Arr::remove($array, '') -> $array
Arr::remove($array, []) -> $array

Arr::remove($array, 'foo.test.abc') ->
[
    'foo' => [
        1,
        'test' => [
            // Removed
            //'abc' => 2,
            'def'
        ],
        [
            'bar' => true
        ],
    ],
]

Arr::remove($array, 'foo.test') ->
[
    'foo' => [
        1,
        // Removed
        /*'test' => [
            'abc' => 2,
            'def'
        ],*/
        [
            'bar' => true
        ],
    ],
]

Arr::remove($array, ['foo', 1, 'bar']) ->
[
    'foo' => [
        1,
        'test' => [
            'abc' => 2,
            'def'
        ],
        [
            // Removed
            //'bar' => true
        ],
    ],
]
```
