I have an array:
$array = array( 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3', 'key4' => 'value4', 'key5' => 'value5', );
and I would like to get a part of it with the specified keys - for example key2, key4, key5 .
Expected Result:
$result = array( 'key2' => 'value2', 'key4' => 'value4', 'key5' => 'value5', );
What is the fastest way to do this?
arrays php
hsz
source share