Voting

: four plus two?
(Example: nine)

The Note You're Voting On

vladas dot dirzys at gmail dot com
12 years ago
Simple key white-list filter:

<?php
$arr
= array('a' => 123, 'b' => 213, 'c' => 321);
$allowed = array('b', 'c');

print_r(array_intersect_key($arr, array_flip($allowed)));
?>

Will return:
Array
(
[b] => 213
[c] => 321
)

<< Back to user notes page

To Top