KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an associative arrays and an array of keys. $A = array('a'=>'book', 'b'=>'pencil', 'c'=>'pen'); $B = array('a', 'b'); How I build an associative array from all element of $A where the key is in $B ? For the example above, the answer should be $C = array('a'=>'book', 'b'=>'pencil');
Tags (comma-separated)
Save Edits
Cancel