Array within a loop
Posted: Mon Jul 28, 2008 11:11 am
Hi,
How can I add to an array without creating a nested array?
Here is my loop currently:
The above outputs the array like so: Array ( [0] => Array ( [59] => Will you be travelling with your partner? ) )
I basically want to get rid of the "holding array" Array([0]=>...) how can i add to the array without having to create as a nested array?
Thanks.
How can I add to an array without creating a nested array?
Here is my loop currently:
Code: Select all
for($x=0; $x<count($questionSelect); $x++)
{
$questionRow=mysql_fetch_array(getQuestion($companyId, $questionSelect[$x]));
$_SESSION['selectedStageQuestionsText'][]=array($questionSelect[$x]=>$questionRow['strQuestionText']);
}
I basically want to get rid of the "holding array" Array([0]=>...) how can i add to the array without having to create as a nested array?
Thanks.