nikic/iter — pull request #8 by ihabunek (2014-01-13 10:00:38+00:00)
Title: Added iter\reindex and iter\fn\path

These two solve a use case which i often have.

You have a nested associative array like this:

```php
$securities = [
[
'seccode' => 'HT-R-A',
'isin' => 'HRHT00RA0005',
'issuer' => [
'code' => 'HT',
'name' => 'Hrvatski Telekom d.d.'
],
],
[
'seccode' => 'INGR-O-11CA',
'isin' => 'HRINGRO11CA1',
'issuer' => [
'code' => 'INGR',
'name' => 'Ingra d.d.'
],
]
];
```

And you want to iterate over it, but with the key being a value from the array.

```php
$path = iter\fn\path('issuer', 'code');
$iter = iter\reindex($securities, $path);
foreach(iter\keys($iter) as $key) {
var_dump($key);
}
```

This yields:
```php
string(2) "HT"
string(4) "INGR"
```