Dear Sir/Madam,

We are a proud user of PHP but we need a function which doesn't seem to exist. 
It is a very simple function which is now created by calling a foreach loop, 
but if it is possible to do this action in the parser, it would be truly 
awesome.





//Example of my idea:

$keys = array(
    'Rss',
    'Channel',
    'Item',
);

$array = array(
    'Rss' => array(
        'Channel' => array(
            'Stuff' => 'Some random stuff I do not need',
            'Item' => array(
                array('An', 'Item'),
                array('One', 'More', 'Item'),
                array('Cn', 'Item'),
                array('The', 'Fourth', 'Item in the items Array'),
            )
        )
    )
);

print_r(array_recursive_keys($array, $structure));
//returns $array['Rss']['Channel']['Item']
/*
* 0 => array(
*     0 => 'An',
 *     1 => 'Item'
* ),
* 1 => array(
*     0 => 'One',
*     1 => 'More',
*     2 => 'Item'
*     ),
* 2 => array(
*     0 => 'Cn',
*     1 => 'Item'
*     ),
* 3 => array(
*     0 => 'The',
*     1 => 'Fourth',
*     2 => 'Item in the items Array'
*),
*/

//You could define array_recursive_keys($array, $keys) as the following:
function array_recursive_keys($array, $keys){
    foreach($keys as $key){
        $array = $array[$key];
    }
    return $array;
}




I am not entirely sure, but I think if the PHP parser can handle this directly 
it would improve the speed a lot.

I will highly appreciate it if you take my enhancement in considoration.

With kind regards,
________________________________
Jelmer Dröge
Developer

[cid:[email protected]]


T: +31 (0)10 - 30 200 30

Weena 73


3013 CH Rotterdam




W: 
www.expandonline.nl<http://www.expandonline.nl/?utm_source=footer&utm_medium=email&utm_campaign=nieuws>

[cid:[email protected]] Jelmer 
Dröge<http://www.linkedin.com/profile/view?id=93198810>

E:   [email protected]

[cid:[email protected]] 
@ExpandOnline<http://www.twitter.com/expandonline>

________________________________
Laatste nieuws<http://www.expandonline.nl/over-ons/nieuws.html>

[cid:[email protected]]

Wat kost een plaatsing? De hamvraag van elke 
(e-)recruiter!<http://www.expandonline.nl/nieuws/wat-kost-een-plaatsing-de-hamvraag-van-elke-e-recruiter>


<<inline: image001.jpg>>

<<inline: image002.jpg>>

<<inline: image003.jpg>>

<<inline: image004.jpg>>

Reply via email to