- array_intersect_key: documentation ( source)
- print_r: documentation ( source)
<?php
$array = [
'two' => 'a',
'three' => 'b',
'one' => 'c',
];
$keyswant = [
'one' => '1',
'three' => '3',
];
print_r(array_intersect_key($keyswant, $array));