This is a discussion on "Looping through arrays" within the Starting Out section. This forum, and the thread "Looping through arrays are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Looping through arrays
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hello
I have changed the process code abit so it receives the data from the form and ensures the data in array format. This has eliminated my previous error. The problem I am experiencing is the looping is not displaying the all contents of the arrays. Do you have any idea what the problem is and how to fix the problem?
echo '<pre>',print_r ($_POST, TRUE), '</pre>';//check array values This display the selected data in the arrays [choice] => Array ( [0] => A001 [1] => A004 [2] => A008 ) [unit] => Array ( [0] => 1 [1] => [2] => 2 [3] => [4] => 3 [5] => [6] => [146] => ) [fee_money] => Array ( [0] => 17.75 [1] => [2] => 30.70 [3] => [4] => 10.25 [5] => [6] => /*****----result of loop-------*****/ |A001|1|17.75 |A004|| |A008|2|30.70 |
|
|
|
|||
|
Re: Looping through arrays
Problem Solved.
Using a for loop to incement the array index syncronizes the array indexes. I think using a two-dimentional array would be better but I don't how to do that yet. This is the code that resolved the problem.
|
![]() |
| Tags |
| php |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Problems with arrays | Scream | JavaScript Forum | 2 | Jan 10th, 2008 16:15 |
| PHP Looping script | peterboy | PHP Forum | 3 | Mar 10th, 2007 00:04 |
| Unique Array of Arrays | ktsirig | Other Programming Languages | 1 | Jan 27th, 2006 16:30 |
| arrays? | macupryk | ASP.NET Forum | 1 | Sep 30th, 2003 12:44 |
| looping background music | gwx03 | Flash & Multimedia Forum | 6 | Sep 7th, 2003 03:07 |