formatting $HTTP_POST_VARS
| From: | Jerry Lake | Date: | Thu, 19 Oct 2000 21:48:12 +0000 |
| Subject: | formatting $HTTP_POST_VARS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21280@lists.php.net to get a copy of this message | ||
I'm trying to format the
results of a form to a webpage
in a nice looking fashion
and I cant seem to get it to
look nice or to work most of the time
here is what I'm trying
any ideas? I think perhaps I've
hit one of those learning plateaus...?
/****************************/
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$longest = 0;
for($i=0; $i<count($key); $i++)
{
if(strlen($key[$i]) > strlen($key[$longest])) $longest = $i;
}
$length = strlen($key[$longest]);
for($i=0; $i<count($key); $i++)
{
$padding = $length - strlen($key[$i]);;
for($j=0; $j<$padding; $j++)
{
$key[$i] .= '.';
}
$key[$i] .= '..: '.$val[$i];
}
$echo $key[$i] .= '..: '.$val[$i];
}
/***************************/
Jerry Lake - jerryl@europa.com
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com