search

Home  >  Q&A  >  body text

I have an array and I need to change the format of the array. The products array does not contain customer information.

<p><br /></p> <pre class="brush:php;toolbar:false;">Array ( [0] =&gt; Array ( [customer_name] =&gt; Gaurav [company] =&gt; ABC Company [gstin] =&gt; GSTIN Number [address] =&gt; Seller Address [mobile_no] =&gt; 9527136311 [email_id] =&gt; seller@gmail.com [invoice_date] =&gt; 26.07.2023 [expiry_date] =&gt; 27.07.2023 [amount] =&gt; 400 [vendor_name] =&gt; Manoj [vendor_email_id] =&gt; grv1gujar@gmail.com [vendor_mobile_no] =&gt; 8169588057 [vendor_gstin] =&gt; GSTIN Number [vendor_address] =&gt; Vendor Address ) [1] =&gt; Array ( [name] =&gt; Product1 [description] =&gt; Product1 [price] =&gt; 50 [quantity] =&gt; 4 [tax_percentage] =&gt; 12 ) [2] =&gt; Array ( [name] =&gt; Product2 [description] =&gt; Product2 [price] =&gt; 25 [quantity] =&gt; 4 [tax_percentage] =&gt; 5 ) [3] =&gt; Array ( [name] =&gt; Product3 [description] =&gt; Product3 [price] =&gt; 10 [quantity] =&gt; 10 [tax_percentage] =&gt; 8 ) [4] =&gt; Array ( [customer_name] =&gt; Swapnil [company] =&gt; XYZ Company [gstin] =&gt; GSTIN Number [address] =&gt; Seller Address [mobile_no] =&gt; 9527136311 [email_id] =&gt; seller@gmail.com [invoice_date] =&gt; 26.07.2023 [expiry_date] =&gt; 27.07.2023 [amount] =&gt; 200 [vendor_name] =&gt; Anoop [vendor_email_id] =&gt; grv1gujar@gmail.com [vendor_mobile_no] =&gt; 8169588057 [vendor_gstin] =&gt; GSTIN Number [vendor_address] =&gt; Vendor Address ) [5] =&gt; Array ( [name] =&gt; ABC [description] =&gt; ABC [price] =&gt; 100 [quantity] =&gt; 2 [tax_percentage] =&gt; 12 ) [6] =&gt; Array ( [customer_name] =&gt; Uday [company] =&gt; PQR Company [gstin] =&gt; GSTIN Number [address] =&gt; Seller Address [mobile_no] =&gt; 9527136311 [email_id] =&gt; seller@gmail.com [invoice_date] =&gt; 26.07.2023 [expiry_date] =&gt; 27.07.2023 [amount] =&gt; 250 [vendor_name] =&gt; Virat [vendor_email_id] =&gt; grv1gujar@gmail.com [vendor_mobile_no] =&gt; 8169588057 [vendor_gstin] =&gt; GSTIN Number [vendor_address] =&gt; Vendor Address ) [7] =&gt; Array ( [name] =&gt; Pen [description] =&gt; Pen [price] =&gt; 75 [quantity] =&gt; 2 [tax_percentage] =&gt; 12 ) [8] =&gt; Array ( [name] =&gt; Pencil [description] =&gt; Pencil [price] =&gt; 20 [quantity] =&gt; 5 [tax_percentage] =&gt; 8 ) )</pre> <p><br /></p>
P粉141455512P粉141455512493 days ago355

reply all(1)I'll reply

  • P粉562845941

    P粉5628459412023-07-28 11:33:06

    Can you explain what you want to do? Please don't just paste a var_dump.

    reply
    0
  • Cancelreply