Personally, I think echoing the hidden fields is a pain. I think $SESSION would be much easier. To use $SESSION to forward these values, you could do something like this. suppose page1.php is the first page of your form and submits to page2.php. Do this in page2.php:
// page2.php - page1.php POSTs to this page.
// first, validate the data from page 1...if it is no good, redirect back to page1.php
// when you are satisfied, save the vars in post
session_start();
$_SESSION['page1_post_vars'] = $_POST;
// now show the 2nd form...
The basic idea is that you call [man]session_start[/man] on any given page and then you can read/write the values in $SESSION. You can put values in $SESSION in one script and then read them in another. It's very convenient. Assuming you have 4 form pages, you might do this on the last page (page5.php) which doesn't have a form itself but handles the submission of the form on page4.php.
//page5.php - page4.php POSTs here
// validate $_POST data from page 4 here. if no good, redirect to page4.php
session_start();
// if you set these values in $_SESSION on previous pages, they should be available
// to you now. you may want to validate all this data to make sure everything has
// been defined and is to your liking.
$p1 = $_SESSION['page1_post_vars'];
$p2 = $_SESSION['page2_post_vars'];
$p3 = $_SESSION['page3_post_vars'];
$p4 = $_SESSION['page4_post_vars'];
If you must use hidden fields, you could do something like this:
foreach($_POST['StretchLen'] as $key => $value) {
echo '<input type="hidden" name="StretchLen[' . $key . ']" value="' . htmlspecialchars($value) . '">';
}