With an array like this:
[
['id' => 1, 'name' => text, 'description' => "desc 1", +50 keys/values...]
['id' => 1, 'name' => text, 'description' => "desc 1", +50 keys/values...]
['id' => 1, 'name' => text, 'description' => "desc 1", +50 keys/values...]
and more...
]
How can i get this result:
[
['id' => 1, 'name' => text, 'description' => "desc 1"]
['id' => 1, 'name' => text, 'description' => "desc 1"]
['id' => 1, 'name' => text, 'description' => "desc 1"]
and more...
]
So the same array but without the 50 array/keys remaining ?
I know i can use unset() on the 50 keys not needed to remove them from the array but i’m looking for a maybe better/clean way to do it. Otherwise i would make a lot of unset to do just for keeping 3 keys.