Re: Can a WHILE be done inside an array?

From: Date: Sun, 01 Apr 2001 16:01:55 +0000
Subject: Re: Can a WHILE be done inside an array?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-46507@lists.php.net to get a copy of this message
Builld the string in a variables by concatenating them (using while), and then put the string in the array. It should be something like this: while($modyear <= $curyear) { echo "<option>".$modyear.; $options = $options . "<option>$modyear" ; $modyear++; } And then in the array, do: $make = array('Make','12','keyword','1:30','select', $temp_option ,'text'); Hope that helps. Reuben D. Budiardja At 06:35 PM 3/31/01 -0600, Kenneth R Zink II wrote:
I'm trying to figure out how to do a WHILE inside of an array. Here is the while statement. $modyear = "1982"; $curyear = date("Y"); $curyear = $curyear + 1; while($modyear <= $curyear){ echo "<option>".$modyear.; $modyear++; } The array I want to use the WHILE in, looks like this. The X is where I want to insert the WHILE. 'year' => array('Year','12','keyword','1:30','select','X','text'), Here is what a functioning array statment in my script looks like for referance. 'make' => array('Make','12','keyword','1:30','select','<option>Chevrolet<option>GMC<op tion>Isuzu<option>Oldsmobile','text'), Can someone please give me some pointers. =) Thanks.
Kenneth R Zink II     Hellcat1@S-Series.Org    ICQ# 5095094
'87 GMC S-15 Ext. Cab (Hurricane) ...BBC 524 being built !!! http://www.s-series.org/htm/windstorm/project-windstorm.htm '85 Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI !!! http://www.s-series.org/htm/firestorm/firestorm.htm '84 Oldsmobile Delta 88 Delta 88 Royal Brougham. Racing by the grace of God!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
Reuben D. Budiardja Web Database Application Programmer / Analyst Devcorps, ITS Goshen College, IN 46526

« previous php.general (#46507) next »