Dynamic array_merge problem

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

 



Hi,

This is the end result I'm trying to get:

$z1 = array_merge($z[0], $z[1], $z[2]);

But what if I don't know how many elements are in $z?  I tried this (but it
breaks if there are more than 2 elements in $z):

for ($i=0; $i<count($z); $i++)
{
    if ($i<(count($z)-1))
    {
        $z1 = array_merge($z[$i], $z[$i+1]);
    }
}

Any pointers would be greatly appreciated!  TIA

[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