Appending information to a single variable in a loop..
Posted: Fri Dec 26, 2003 2:04 pm
I've got an array.
I've got a foreach loop.
I've got one variable.
Each time the foreach loop runs, I want information from a specified array appended on to the end of a specified variable.
This is what I'm trying to accomplish:
I've got a foreach loop.
I've got one variable.
Each time the foreach loop runs, I want information from a specified array appended on to the end of a specified variable.
This is what I'm trying to accomplish:
Code: Select all
<?
foreach($q_array as $questions)
{
// This code will cause the $q_var variable to be overwritten each time the loop passes, which is what I don't want. How do I append each piece of information to the end of the variable?
$q_var = $questions
}
?>