Reputation: 4262
Something like the would be nice:
$name = unset($array['username']);
Leaving $array without a username but assigned to $name.
I'm just looking for the least complex way of doing this really.
Upvotes: 0
Views: 426
Reputation: 12099
unset
has void
as return type.
void unset ( mixed $var [, mixed $... ] )
You can do it like this:
$name = $array['username'];
unset($array['username']);
Upvotes: 2