Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-28 Thread Micky Hulse
Hi Adam! On Tue, Feb 28, 2012 at 2:05 PM, Adam Richardson wrote: >> What would be the best way to insert $o_insert array into $o array >> after specified key? Great question. :D Quick answer: It's a Wordpress thang! Long answer: I am working with WordPress and the theme that I am using stores

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-28 Thread Adam Richardson
On Mon, Feb 27, 2012 at 9:12 PM, Micky Hulse wrote: > Howdy! > > Example code: > > > > What would be the best way to insert $o_insert array into $o array > after specified key? > > I hate to just ask for example code, but I can't seem to find the > perfect solutio

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Micky Hulse
Hi Xucheng, On Mon, Feb 27, 2012 at 7:41 PM, xucheng wrote: > Maybe you can trans the array into a xml tree , then modify its leaves . Now that sounds like an interesting idea... I will have to research that as an option. Thanks for tip! :) @Eray, I was not able to get your code to work on my

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread xucheng
Maybe you can trans the array into a xml tree , then modify its leaves . RTFSC - Read The F**king Source Code :)! 2012/2/28 Micky Hulse > Thank you Eray! That's a cool approach. Testing code now. I will be > back with my results. :) > > Thank you!!! > > Cheers, > M > > -- > PHP General Mailing

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Micky Hulse
Thank you Eray! That's a cool approach. Testing code now. I will be back with my results. :) Thank you!!! Cheers, M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-27 Thread Eray Alakese
$newarray = array() ; foreach($o as $key => $val) { if($prevkey != 'specifickey') { $prevkey = $key; $newarray[$key] = $val; } else $newarray[] = $o_insert; } i think this would help you. i can't test it, I'm sending this from mobile phone :-) Eray Alakese 28 Şub 2