Re: [PHP] Recursive array_push?

2006-01-26 Thread Richard Lynch
On Thu, January 26, 2006 2:50 am, Kim Christensen wrote: > Has anyone out there stumbled over the issue of making > multi-dimensional arrays out of bracket-separated strings? In a less > fuzzy way of putting it: > > $str = "[layer1][layer2][layer3][layer4]" > > would become > > $str_array = Array(

Re: [PHP] Recursive array_push?

2006-01-26 Thread David Grant
Kim, After some contemplation (and slightly less crack): $array); } print_r($array); ?> Array ( [layer1] => Array ( [layer2] => Array ( [layer3] => Array ( [layer4] => FOO

Re: [PHP] Recursive array_push?

2006-01-26 Thread Jochem Maas
Kim Christensen wrote: Has anyone out there stumbled over the issue of making multi-dimensional arrays out of bracket-separated strings? In a less fuzzy way of putting it: $str = "[layer1][layer2][layer3][layer4]" would become $str_array = Array( [layer1] => Array( [layer2] => Array( [layer3]

Re: [PHP] Recursive array_push?

2006-01-26 Thread David Grant
Kim, May the hack-o-rama commence: It works, but I'm not proud. :P David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Recursive array_push?

2006-01-26 Thread Robin Vickery
On 1/26/06, Kim Christensen <[EMAIL PROTECTED]> wrote: > > I would really like PHP to have a function of building expressions > with strings, and then execute them through a function - but that's > just me it seems :-) > You mean like create_function() ? -robin

[PHP] Recursive array_push?

2006-01-26 Thread Kim Christensen
Has anyone out there stumbled over the issue of making multi-dimensional arrays out of bracket-separated strings? In a less fuzzy way of putting it: $str = "[layer1][layer2][layer3][layer4]" would become $str_array = Array( [layer1] => Array( [layer2] => Array( [layer3] => Array( [layer4] ) ) )