I am obviously a beginner coder, and I read various posts trying to do the following:
I have a form containing many <textarea> input fields, 150 rows and three columns (the reason why they <textarea> are associated with special javaScript functionality that I will not go into details with, but that matters <textarea> ) .
Here is a capture of how it looks (but before 150):

I submit the form to another page, PHP, of course, where I want to do three things:
1) Display a summary of certain parameters (date of dispatch, amounts, calculations, etc.)
2) Assign variables corresponding to all 450 common inputs using loops somehow
3) Create, save and create a link for the user to download the CSV data file.
Step 1), if pretty much done, no dram there
Step 3) I am sure that I can work, as there are many good tutorials for writing files with php.
Step 2), where I am at a loss.
It is also important to note:
A) Not all lines must be completed when submitting the form; although a separate line should be completed
B) Posting (right word?) In a loop should be limited only by the maximum number of completed lines. Therefore, I do not think that the direct for() loop will work, since it will return all 150 lines, even if empty.
I played with a bit of code that I found here using foreach() , this post .
Here is the code that I combined Frankenstein, it returns ok (only for the first column {let call it column_A}, and it is limited by the number of fields filled using column_A as a ruler.
foreach($_POST as $name => $inputA) { if(strpos($name, 'column_A')===0) { if($inputA !== ''){ echo $i , " )" , " " , $inputA , "<br />"; $i++; } } }
Therefore, if I fill in 5 lines, with some data, then this code will return:
1) column A one
2) column A two
3) column A three
4) column A four
5) column A five
But I also need to echo the column column_B and column_C along column_A. as below:
1) column A one, column B one, column C one
2) column A two, column B two, column C two
3) column A three, column B three, column C three
4) column A four, column B four, column C four
5) column A five, column B five, column C five
Therefore, there may be an en echo statement, for example:
echo $i , " )" , " " , $inputA , " " , $inputB, " " , $inputC , "<br />";
I tried to read in strpos() and for() and foreach() in the PHP manual, but I hardly get it. Sorry for a long time, wanted to paint a good picture.