If I have an array that has more info than I need and I want to pull out a subset of its name value pairs I have come up with 2 methods.
Both rely on this:
$detailkeys=array(title,summary,subtitle,url,imgsrc,description);
The method I came up with on my own:
foreach ($detailkeys as $keyname) {
$details[$keyname]=$data[$keyname];
}
The method I found online:
// get just the desired parts of $data and put them in $details.
$details=array_intersect_key($data, array_flip($detailkeys));
The second method, with a decent comment, is what I chose, but wanted to see what anyone else had to say about it.