← All built-ins / unset()
unset()
unset(...$args): void
Parameters
| Name | Type | Description |
|---|---|---|
| $var | mixed | array element to remove |
Return value
Removes the element from the array.
Example
$m = ["a" => 1, "b" => 2]; unset($m["a"]); echo count($m), " ", $m["b"];
1 2