Getting Arrays in to the form I need

    Date: 12/29/05 (PHP Community)    Keywords: no keywords

    I have two arrays

    Array1
    (
        [inv1] => Subtotal1
        [inv2] => Subtotal2
    
    }
    
    
    Array2
    (
        [inv1] => Array
            (
                [0] => ID
                [1] => DATE1
                [2] => LastName
                [3] => FirstName
            )
        [inv2] => Array
            (
                [0] => ID
                [1] => DATE2
                [2] => LastName
                [3] => FirstName
            )
    }


    that I need to get in to this form


    Array3
    (
        [0] => Array
            (
                [ID] => Array
                    (
                        [0] => inv1
                            )
                              [0] => DATE1
                              [1] => Subtotal1
                            )
                        [1] => inv2
                            )
                              [0] => DATE2
                              [1] => Subtotal2
                            )
    
                        [2] => LastName
                        [3] => FirstName
                    )
             )
    )




    if it helps, I can change the structure of Array2. Thanks guys - I have been at this all day and cant seem to figure out how to juggle it.

    Array2 is created with this query
    SELECT invoice_main.invoice_number, invoice_main.clientid, invoice_main.due_date, clients.ClientLast, clients.ClientFirst
    FROM invoice_main
    LEFT JOIN clients ON invoice_main.office_id=clients.office_id AND invoice_main.clientid=clients.ClientID
    WHERE invoice_main.office_id='$office_id'
    ORDER BY invoice_number

    Source: http://www.livejournal.com/community/php/384906.html

« Mini PHP/MySQL Gallery || PHP to ASP? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home