Re: Insert new array after specific key in multidimensional array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$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 2012 04:13 tarihinde "Micky Hulse" <mickyhulse.lists@xxxxxxxxx>
yazdı:

> Howdy!
>
> Example code:
>
> <https://gist.github.com/1928452>
>
> 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 solution. :(
>
> Many thanks in advance for the help!
>
> Cheers,
> Micky
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux