Answer the question
In order to leave comments, you need to log in
Get data from the array by the keys of another?
there is an array:
$arr = array('one' => 1, 'two' => 2, 'three' => 3);
$other = array('two','three');
Answer the question
In order to leave comments, you need to log in
$arr = array('one' => 1, 'two' => 2, 'three' => 3);
$other = array('two', 'three');
var_dump(array_intersect_key($arr, array_flip($other)));
array_column use if 5.5 and above php version
php.net/manual/en/function.array-column.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question