RE: [PHP] need help w a for loop
| From: | Chris W. Parker | Date: | Mon, 20 Oct 2003 21:56:05 +0000 |
| Subject: | RE: [PHP] need help w a for loop | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166856@lists.php.net to get a copy of this message | ||
Ray Hunter <mailto:bigdog@venticon.com>
on Monday, October 20, 2003 2:47 PM said:
> Or you could try this:
>
> $categories_array = array();
>
> for( $j = 0; $j < $categories_count; $j++ ) {
> $tempval = "str_categories".$j;
> $categories[$j] = $_REQUEST[$tempval];
> }
Or you could get really fancy and try this (my preferred method if not a
little confusing):
$j = -1;
$categories_array = array();
while(++$j < $categories_count)
{
$categories[$j] = $_REQUEST["str_categories".$j];
}
c.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/