PHP Dynamic Variables?

I it possible to have variables concatenated together?
For instance, in a loop you’ve got something like this:


$variable = "multipleSomethings";
for($num=1;$num<=10;$num++) {
	$variable.$num = "multipleSomethings" . $num;
}

See what I’m saying?

Now try to understand my code. :smiley: :eyebrowlift:


case 'pendCalendar':
	// Get all the calendar events that haven't been accepted yet, and display them
	print '<div class="para">' .
			'<h1>Pending Calendar Additions</h1>' .
			'The following are requests from coaches which have not yet been approved.<br />' .
			'Please check the information for accuracy, and then decide whether or not to accept the request.<br />' .
			'<strong>Be sure to check whether there are existing events that might cause a confliction.</strong><br /><br />' .
			'<form action="admin.php?action=updateCalendar" method="post">' .
			'<table cellpadding="0" cellspacing="0" style="border: 1px solid #666;" width="100%">' .
				'<tr>' .
					'<td style="background: #999; padding: 3px;" width="25%"><strong>Event Date:</strong></td>' .
					'<td style="background: #999; padding: 3px;" width="20%"><strong>Event Location:</strong></td>' .
					'<td style="background: #999; padding: 3px;" width="30%"><strong>Event Description:</strong></td>' .
					'<td style="background: #999; padding: 3px;" width="25%"><strong>Accept?</strong></td>' .
				'</tr>';

	guestLogin($username,$password);
	$query = mysql_query( "SELECT * FROM calendar07 WHERE accept='0' " );
	$num = 1;
	while($fetch = mysql_fetch_assoc($query)) {
		print '<input name="hidden_' . $num . '" type="hidden" value="' . $fetch['id'] . '>';
		print '<tr>' .
					'<td style="padding: 5px;" valign="top">' . $fetch['month'] . ' ' . $fetch['day'] . ': ' . $fetch['time'] . '</td>' .
					'<td style="padding: 5px;" valign="top">Field ' . $fetch['field'] . '</td>' .
					'<td style="padding: 5px;" valign="top"><em>Requested by: </em>' . $fetch['leader'] . '<br />' .
					'<em>Brief Summary: </em>' . $fetch['desc'] . '</td>' .
					'<td style="padding: 5px;" valign="top"><select name="event_' . $num . '">' .
						'<option value="accept">Accept Event</option>' .
						'<option value="deny">Refuse Event</option>' .
					'</select>' .
					'</td>' .
				'</tr>';
	}

	print '<tr>' .
			'<td colspan="4" style="text-align: right;"><input type="submit" value="Submit" /></td>' .
			'</tr>' .
			'</table>';
	break;
case 'updateCalendar':
	$num = 1;
	do {
		if (isset($_POST["event.$num"])) {
			$accept.$num = $_POST["event.$num"];
			$id.$num = $_POST["hidden.$num"];
			$num++;
			$set = 'true';
		} else {
			$max = $num;
			$set = 'false';
		}
	} while($set='true');
	
	break;