hi i've changed my loop to for($j=0; $j < $categories_count; $j++){ $categories_array = array(); $tempval="str_categories".$j; array_push($categories_array,$_REQUEST[$tempval]); }
echo $categories_array[0]; //echoes nothing (should be a string value that was +previously at $_REQUEST['$str_categories0'] echo $tempval; //gives me 'str_categories9' $str_categories0=$_REQUEST['str_categories0']; echo $str_categories0; //gives me the string 'Newspaper' i'd like to append 'Newspaper' to the array... thanks redmond [Mon, Oct 20, 2003 at 02:26:49PM -0700] This one time, at band camp, Chris W. Parker said: > Redmond Militante <mailto:[EMAIL PROTECTED]> > on Monday, October 20, 2003 2:15 PM said: > > > for($j=0; $j < $categories_count; $j++){ > > $categories_array = array(); > > $tempval="str_categories".$j; > > array_push($categories_array,'$_REQUEST['.$tempval.']'); > > } > > > > it looks like it's appending the string > > '$_REQUEST['str_categories0']' to the array $categories_array > > that's because you've got: > > > array_push($categories_array,'$_REQUEST['.$tempval.']'); > > and not: > > > array_push($categories_array,$_REQUEST[$tempval]); > > > > Chris. > > -- > Don't like reformatting your Outlook replies? Now there's relief! > http://home.in.tum.de/~jain/software/outlook-quotefix/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- FreeBSD 5.1-RELEASE-p10 FreeBSD 5.1-RELEASE-p10 #0: Fri Oct 3 21:30:51 CDT 2003 4:30PM up 6 days, 8:11, 3 users, load averages: 1.00, 1.00, 1.00 Fights between cats and dogs are prohibited by statute in Barber, North Carolina.
pgp00000.pgp
Description: PGP signature