Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8699065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:51:27+00:00 2026-06-13T01:51:27+00:00

I have a php form that allows the user to add multiple copies of

  • 0

I have a php form that allows the user to add multiple copies of three fields (installed item, description, and quantity). The results of each field are captured in an array.

I am sending the results via an email form. Currently I have it set to the following:

$email_body = "Date: $date \n".
   "Installed Items: \n" . implode("\n", $_POST['installed']) . "\n" .
   "Installed Description: \n" . implode("\n", $_POST['installed-description']) . "\n" .
   "Installed Quantity: \n" . implode("\n", $_POST['installed-quantity']) . "\n";

It displays like this in the email:

Installed Items:

Item 1
Item 2
Item 3

Installed Description:

Description 1
Description 2
Description 3

Installed Quantity:

Quantity 1
Quantity 2
Quantity 3

I would like for it to display as follows:

Item 1
Description 1
Quantity 1

Item 2
Description 2
Quantity 2

etc...

Any help would be appreciated (and, I’m pretty new to PHP so pardon the noob-ness of this question).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:51:28+00:00Added an answer on June 13, 2026 at 1:51 am

    In this case I would recommend to use a for loop:

    for($i = 0; $i < COUNT($_POST['installed']);$i++)
    {
       $msg .= 'Item '.$i.'\n';
       $msg .=  $_POST['installed'][$i].'\n';
       $msg .=  $_POST['installed-description'][$i].'\n';
       $msg .=  $_POST['installed-quantity'][$i].'\n';
       $msg .= '\n'; //extra space between the items
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that allows the user to add more form fields if
I have a form that allows the user to add as many upload forms
I have a form that allows a user to add an unlimited number of
I have a form (will add form validation later) that allows the user to
I have a page that allows the user to add and remove text fields
I have a form (code below) that allows a user to upload an image
I have setup a form that allows a user to make selections from drop-down
I have an html form that allows the user to browse for a file
I have a photo-upload form that allows a user to upload 1 photo. But
I have a form that allows the user to push an up or down

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.